I have a datagridview with a datagridviewcomboboxcell in a C# winform application. I am easily able to capture when a new item is selected because the CellValueChanged event fires. However, I would like to be able to detect when the combobox is opened, but the user picks the same value that was already selected. How can I capture this?
I have a datagridview with a datagridviewcomboboxcell in a C# winform application. I am
Share
A combination of the
EditingControlShowingevent and some combo box events works1.EditingControlShowingallows us to access the embedded combo box control:I’ve added a private class level variable to the form to store the combo box selected index.
1. This solution fires every time the combo box is opened and closed – if you want something else (such as when the combo box commits it’s change to the grid) update your question describing the exact behaviour.