I have got a list box in multi select mode which is data bound with 15 values from a database. I have this code to display the selected values of each item selected in the list box:
foreach (var list in list_box.SelectedItems)
{
MessageBox.Show(list_box.SelectedValue.ToString());
}
Unfortunately, the correct amount of message boxes display but they only display the selected value of the first item in the list that has been selected.
Please can someone help me with this issue? I have been searching the net but I cannot find one example that works correctly!
I came back to this issue and solved it by doing this:
Thanks for your help!