Reputation: 432
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?
Upvotes: 7
Views: 1961
Reputation: 11
Also you can do :
datagridview1.CommitEdit(DataGridViewDataErrorContexts.Commit);
if you want to not end edit and your value to be committed.
Upvotes: 1
Reputation: 17855
On the CurrentCellDirtyStateChanged event of your DataGridView, you can call the following code:
myDataGridView.EndEdit(DataGridViewDataErrorContexts.Commit)
Upvotes: 8