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:
I think the only way you'll be able to select multiple items is by using a foreach loop. The SelectedValue property only seems to return 1 item. If you want to select more then 1 item you'll have to use :
var tempListBox = c As ListBox;
if (tempListBox != null)
(tempListBox.SelectedItems.Add(tempListBox.Items[tempListBox.FindStringExact(fieldValue)]);
Also the FindStringExact doesn't search through the Value fields it only looks through the displayed text. Also to cut down on code might want to cast a new variable as a listbox so you don't keep casting C as a listbox.