.NET WinForms - Programmatically End Current Edit - DataGridView

二次信任 提交于 2019-12-22 22:55:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!