Event triggered after writing in a combobox c#

128 Views Asked by At

I want to modify the Items of a DataGridViewComboBoxCell after changing the text of the DataGridViewComboBoxCell.

I'm casting the DataGridViewComboBoxCell to a ComboBox during the EditingControlShowing, so I can change the ComboBoxStyle to ComboBoxStyle.DropDown.

Then after a key is pressed I want to change the Items list according to the new text, the problem is with the key pressed Events, the text remains the same, so I have to parse the key input, depending on the type of key entered, if it's a deleting key, or if there is a shift pressed, etc. So I would prefer to use an event triggered after this text is changed, so I don't have to parse the key pressed.

Which event should I use for this?

Thanks

1

There are 1 best solutions below

0
大陸北方網友 On BEST ANSWER

If you want to check if the text in ComboBox changed, you can subscribe to TextUpdate event. It occurs when the combo box text has changed.