G
Guest
I have a data bound combo box. The combo box displays several items (status
code descriptions). After the combo box is bound, I want to set the combo box
so that the "Draft" status is displayed by default. Since the data originally
comes from a database I don't know which position in the combo box it will be
and I don't want to hardcode the status_code field (I want to select the
combo box item based upon status_desc).
cb_status.DataSource = ds.Tables["status_code"];
cb_status.DisplayMember = "status_desc";
cb_status.ValueMember = "status_code";
// set combo box to display "Draft" status by default
Thanks in advance
code descriptions). After the combo box is bound, I want to set the combo box
so that the "Draft" status is displayed by default. Since the data originally
comes from a database I don't know which position in the combo box it will be
and I don't want to hardcode the status_code field (I want to select the
combo box item based upon status_desc).
cb_status.DataSource = ds.Tables["status_code"];
cb_status.DisplayMember = "status_desc";
cb_status.ValueMember = "status_code";
// set combo box to display "Draft" status by default
Thanks in advance