G
G-Fit
Hello group,
I have a ListBox control, populated by a DataSet with a DisplayMember and
a ValueMember.
I have a list of values (a string[] in my case), and I'd like the ListBox
control to show all items whose value it can find in this list, as selected.
It seems I can't find the way to do this, because I don't know how to set
the state of one item to 'selected'. Here is what I got so far:
foreach (object o in listBox1.Items)
{
DataRowView view = (DataRowView) o;
foreach (string s in myValues)
{
if (view.Row["value"].ToString() == s)
?????
}
}
Thanks
Karine Proot
I have a ListBox control, populated by a DataSet with a DisplayMember and
a ValueMember.
I have a list of values (a string[] in my case), and I'd like the ListBox
control to show all items whose value it can find in this list, as selected.
It seems I can't find the way to do this, because I don't know how to set
the state of one item to 'selected'. Here is what I got so far:
foreach (object o in listBox1.Items)
{
DataRowView view = (DataRowView) o;
foreach (string s in myValues)
{
if (view.Row["value"].ToString() == s)
?????
}
}
Thanks
Karine Proot