CheckedListBox - ValueMember

  • Thread starter Thread starter Tonya
  • Start date Start date
T

Tonya

Hi!

I have a CheckedListBox, bound to a DataSet using
DisplayMember and ValueMember. I need to have the
ValueMember of all checked items in run time. the only
way to receive ValueMember is through the SelectedValue,
which is not useful in my situation.


what is the best way to have the collection of
ValueMembers, based on the collection of Checked items?

Thanks in advance,
Tonya.
 
Iterate through the SelectedItems instead

int val;
foreach(DataRowView dr in listBox1.SelectedItems)
{
val = int.Parse(dr[ listBox1.ValueMember ]);
MessageBox.Show( this, "Value = " & val.ToString());
}
 
Back
Top