I have a combobox control hosted in a unbound DataGridView control. When the user selects an item (or types an entry and hits enter) I want it to apply the change and come out of edit mode.
Is this possible?
On the CurrentCellDirtyStateChanged event of your DataGridView, you can call the following code:
myDataGridView.EndEdit(DataGridViewDataErrorContexts.Commit)
Also you can do :
datagridview1.CommitEdit(DataGridViewDataErrorContexts.Commit);
if you want to not end edit and your value to be committed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With