I feel like this question has been asked before, but I couldn't find it.
I think I am missing something obvious.
Basically I am going to have a DataGridView with two columns. One textbox, one combobox.
The textbox column is going to be coming from a database (actually I could manually create it if i had to). It makes about 20 rows, each with a unique value for the textbox column.
The available choices for the combobox row are coming from a list (I apply it as a datasource currently, it might be better if I manually add the items?)
So for each entry, you can pick a value from a combox, pretty simple, that part works.
Now what I want is, based on some criteria, that a certain value in the combobox field be "selected" by start, instead of an empty box.
I am roughly going to take a particular string, and if its a choice in the combobox, select it. If it is NOT a choice, select the first item in the combobox.
I cannot seem to set the combobox value. With a regular combobox, there is a .Contains on the items (items is always empty when using a datasource) and then is has a .SelectedItem property. The Selected whatever properties aren't on thse DataGridViewComboBox cells.
I have tried just setting the .Value property of the cell, which correctly triggers the DataError event if it's not a choice, but then the value cannot be re-set based on that?
EDIT: I attached a picture of desired output. I can correctly set the values (using the Items.Contains()) now, but it only actually sets the value if I have "looked" at the DataGridView first (its on another tab)