I have 2 ComboBox in DataGridView (DataGridViewComboBox), let say Type ComboBox ("Type I" & "Type II") and Options ComboBox. DataGridView and Type ComboBox datasource are set when Form Load. Options ComboBox datasource depend on Type ComboBox selected value.
If Type combobox selected value set to "Type I" then "Options" combobox is enabled, then if Type combobox selected value set to "Type II" then "Options" combobox is disabled.
The problem is, when I input "Type I", and I input "Options" and commit. Then I edit "Type I" to "Type II", I set "Options" combobox datasource to null and disabled it, but "Options" combobox text still display last selectedMember text.
How to clear "Options" combobox text when I edit "Type" combobox ?
Try to set "SelectedIndex = -1" of option combobox on selectedIndexChange event of combobox TypeI.
OptionsComboBox.SelectedIndex = -1;