G
Guest
Hi,
I have a list box lstMy which is bound to a datatable dt.
The SelectionMode in the listbox is set to MultiSimple.
I want to run through the listbox and return all _values_ from the selected items. In other words, if it were to be a single select listbox i would just refer to it as lstMy.SelectedValue however in the multiple select I cannot do that. Plus I am running through the list using a for loop.
Logically my code should look like this:
for i = 0 to lstMy.Items.Count -1
if lstMy.Selected
return lstMy.Item(i).Value
next i
however, I can't make it work.
Any help will be greatly appreciated.
Thanks.
I have a list box lstMy which is bound to a datatable dt.
The SelectionMode in the listbox is set to MultiSimple.
I want to run through the listbox and return all _values_ from the selected items. In other words, if it were to be a single select listbox i would just refer to it as lstMy.SelectedValue however in the multiple select I cannot do that. Plus I am running through the list using a for loop.
Logically my code should look like this:
for i = 0 to lstMy.Items.Count -1
if lstMy.Selected
return lstMy.Item(i).Value
next i
however, I can't make it work.
Any help will be greatly appreciated.
Thanks.