G
Guest
I seem to be having trouble trying to select the right value in a ComboBox
DataSourced by a DataTable with a value for a DataRow...
For example... In a Windows Form, I have a ComboBox:
ComboBox box = new ComboBox(whatever);
box.DataSource = myDataTable;
box.DataMember = "the_column";
// now select value already in a passed DataRow
DataRow row (the row that's passed in frmo somewhere)
box.SelectedItem = row["the_column"];
Doesn't work...
I tried many variations with TypeCasting and can't get it to work- what's
the secret here?
DataSourced by a DataTable with a value for a DataRow...
For example... In a Windows Form, I have a ComboBox:
ComboBox box = new ComboBox(whatever);
box.DataSource = myDataTable;
box.DataMember = "the_column";
// now select value already in a passed DataRow
DataRow row (the row that's passed in frmo somewhere)
box.SelectedItem = row["the_column"];
Doesn't work...
I tried many variations with TypeCasting and can't get it to work- what's
the secret here?