Well, the short answer is that it shouldn't do this. Now, we just need to
figure out why. When is this code being executed? Do you have the right
number of items? Are you databinding the control again prior to iterating
through it, in which case the framework will see it as fresh with no items
selected?
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"David" <an*******@discussions.microsoft.com> wrote in message
news:5D**********************************@microsof t.com...
I have a problem with the Listbox Web control in C#. It works fine in VB
but in C#, the .Selected property always returns false for some reason. I
have the Listbox Selectionmode set to Multiple. Can anyone tell me why?
This is in Visual Studio.NET 2002.
Code:
foreach ( ListItem oItem in lstPeriods.Items )
{
if ( oItem.Selected == true ) // This always returns false!
{