Don Ireland

Don Ireland

  • NA
  • 27
  • 7.2k

DataGridView Column is ComboBox. Set initial Value?

Apr 6 2014 8:40 PM
I have a DGV in which one of the columns is a combobox type.  The DGV is bound to a BindingDataSource object.  The field assigned to the column in question contains 1 string for each row in the following format:  "1/0", "0/1", "0/0". 

The combobox column is defined as follows:
DGV.DataSource="bndSrcCat";
DGV.ValueMember="origID";
DGV.DisplayMember="name";

The 2nd BindingDataSource object (bndSrcCat) contains three properties:  id, origID & name.

When I run my app in debug mode, the DGV populates with the data.  The comboboxes all get populated correctly based on the second BindingDataSource but not a one of them is preselected to the proper value based on the value from the the first BindingDataSource object.

I've attached a screenshot of my app running.  Hopefully it'll help you understand what I'm describing.



TIA!

Answers (3)