csharper csharper - 2 months ago 21
ASP.NET (C#) Question

listbox; number of selected items

While using listbox in c#, how can learn the count of selecteditems?

Listbox items: A,B,C,D. For example, I select C and D.

I want to make a loop in order to assign selecteditems.

How can I achieve it? How can I learn the number of selected item?

Thank you

Answer

Maybe you are looking for this listbox1.GetSelectedIndices().Count();

Comments