Browsing a ListBox
-
Hey, I need to browse a multiselection ListBox, especially getting the Values of selected items. I filled it like this : lbox.DataSource = 'some datatable'; lbox.DisplayMember = "Col1"; lbox.ValueMember = "Col2"; The SelectionMode chose is : MultiSimple I need something like this foreach (item in the selected items) { Display its value.. etc } Thank you.
-
Hey, I need to browse a multiselection ListBox, especially getting the Values of selected items. I filled it like this : lbox.DataSource = 'some datatable'; lbox.DisplayMember = "Col1"; lbox.ValueMember = "Col2"; The SelectionMode chose is : MultiSimple I need something like this foreach (item in the selected items) { Display its value.. etc } Thank you.
a ListBox has a lot of useful properties, some related to the current selection; I would not be surprised if the documentation would show some with names starting with Selected. Would you care to read up on them? :)
Luc Pattyn [Forum Guidelines] [My Articles]
Happy Holidays!
-
a ListBox has a lot of useful properties, some related to the current selection; I would not be surprised if the documentation would show some with names starting with Selected. Would you care to read up on them? :)
Luc Pattyn [Forum Guidelines] [My Articles]
Happy Holidays!
Hey, Of course I've done many research before asking here.. The problem i have is not with getting the collection of selectediems (lbox.SelectedItems and lbox.SelectedIndices..etc) but when trying to retrieve the Value associated to a selecteditem.. Thanks.. for not helping..:-D
-
Hey, Of course I've done many research before asking here.. The problem i have is not with getting the collection of selectediems (lbox.SelectedItems and lbox.SelectedIndices..etc) but when trying to retrieve the Value associated to a selecteditem.. Thanks.. for not helping..:-D
if the ListBox.DataSource is a DataTable, isn't each item in the ListBox a DataRow? :doh:
Luc Pattyn [Forum Guidelines] [My Articles]
Happy Holidays!
-
if the ListBox.DataSource is a DataTable, isn't each item in the ListBox a DataRow? :doh:
Luc Pattyn [Forum Guidelines] [My Articles]
Happy Holidays!