C# - Get Selected Values from MultiSelect ListBox
Here is a way of retrieving the selected values of Multiselect listbox
for (int i1 = 0; i1 < listBox1.SelectedItems.Count; i1++) { DataRowView D1 = listBox1.SelectedItems[i1] as DataRowView; MessageBox.Show(D1[1].ToString()); }The above code uses SelectedItems collection to retrieve information
ListBox doesn't contain a definition for SelectedItems.count
ReplyDeleteYes it does... but it does not have it for "SelectedItem" (missing "s").
ReplyDeleteYes it does, but it does not have it for "SelectedItem" (missing "s")
ReplyDelete