How To Iterate List All Selected Items In A Databound Listbox In Net 4 0 Winforms
- 07 May 2010
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!
<< Go Back