Setting selected item in a ListBox without looping

后端 未结 7 1571
萌比男神i
萌比男神i 2020-12-31 19:00

I have a multi-select listbox which I am binding to a DataTable. DataTable contains 2 columns description and value.

Here\'s the listbox populating code:

         


        
相关标签:
7条回答
  • 2020-12-31 19:28

    If you do not want looping for selected items then retrieve selected value of list box from the listBox_SelectedIndexChanged event and add that value in global array. Then by accessing that array you would get desire selected items value of itemlist with out any loop.

    0 讨论(0)
提交回复
热议问题