问题
How can you programmatically end the current cell edit without losing the change? I have my DataGridView set to EditOnEnter mode. I tried EndEdit() on the grid but this backs out the current edit.
回答1:
Assuming this is remarkably close to what I've done with the grid and without seeing any code, the only thing I did differently was to follow the call to EndEdit on the DataGridView with a call to EndEdit on the BindingSource.
来源:https://stackoverflow.com/questions/1394364/net-winforms-programmatically-end-current-edit-datagridview