ASP.NET lisbox - Selected first item, always

Posted by Lijo on Stack Overflow See other posts from Stack Overflow or by Lijo
Published on 2010-05-01T17:39:51Z Indexed on 2010/05/01 17:47 UTC
Read the original article Hit count: 143

Filed under:
|
|

I have a list box which is populated using a dictioanry. When I iterate throught the selected items using the following code, it always show only the first items as selected - even if the first item is not selected.

Have you ever encountered this scenario?

Could you please help on this?

 foreach (ListItem item in lstProcessName.Items)
     {

            if (item.Selected == true)
            {
                    selectedNewSales.Add(item.Text);
            }
}

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about listbox