G
Guest
I'm getting myself confused about the new BindingSource. In the old days I'd
bind a combobox like this to show the "productName" field:
DataSet ds = getDS();
cboX.DataSource = ds.Tables["Products"];
cboX.ValueMember = "productID";
cboX.DisplayMember = "productName";
Now I guess I can do this:
BindingSource bs = new BindingSource(getDS(), "Products");
which sets the bs.DataSource and the bs.DataMember (ie the table within the
dataset).
But, how do I tell it what field to display when the table has multiple
fields? There is no longer any DisplayMember or ValueMember property.
bind a combobox like this to show the "productName" field:
DataSet ds = getDS();
cboX.DataSource = ds.Tables["Products"];
cboX.ValueMember = "productID";
cboX.DisplayMember = "productName";
Now I guess I can do this:
BindingSource bs = new BindingSource(getDS(), "Products");
which sets the bs.DataSource and the bs.DataMember (ie the table within the
dataset).
But, how do I tell it what field to display when the table has multiple
fields? There is no longer any DisplayMember or ValueMember property.