listbox - Multi select option

Sashikala

New member
Joined
Dec 15, 2011
Messages
4
Programming Experience
5-10
I had set the multiselect option to true for listbox.

Let me know how to move the list items up and down with this option.

regards,
Sashi
 
The multiselect functionality of a Listbox does not automatically enable you to move elements - it does exactly what it says... allows for multiple items to be selected at once. How you process that is entirely up to you.

Take a look at Multiselect Items in a List Box Sample which should give you an idea of how to parse the listbox selection(s)
 
If you want to move an item in a ListBox then you have to remove it and then insert it at the desired index. You can get the index of the currently selected item from the SelectedIndex property. If there are multiple selections then use the SelectedIndices collection. Just keep in mind that it might contain zero, one, two or more values.
 
Back
Top