How to iterate (list) all selected items in a Databound ListBox in .NET 4.0 Winforms
A seemingly easy thing to do that I could not find documentation for!
string astr;
foreach (DataRowView aRow in listBox1.SelectedItems )
{
astr = aRow["TopicId"].ToString();
astr = aRow["TopicText"].ToString();
}
TopicId and TopicText are the name of the columns in the table of the Datasource that has been bound to the listbox control.
Drop me a note if you found this useful!