我有一个带有复选框列的网格视图,我想在单元格的值被切换后立即触发绘图事件.我尝试了 ValueChaged 和 CellEndEdit 和 BeginEdit,并选择了 CellSelect 作为选择模式.对于前2个事件,该事件是在编辑模式完成时触发的,例如移出当前单元格,或来回移动.这只是一种奇怪的行为.
I have a grid view that has a check box column, and I want to trigger a drawing event as soon as the value of the cell is toggled. I tried the ValueChaged and the CellEndEdit and BeginEdit, and chose the selection mode as CellSelect. As for the the first 2 events, the event was triggered upon the finishing of the edit mode, like moving out of the current cell, or going back and forth. It's just a weird behavior.
是否有任何内容会在单元格值更改后立即触发网格视图上的事件?
Is there anything that triggers the event on the grid view as soon as the cell value is changed?
推荐答案我的一位同事建议捕获 CurrentCellDirtyStateChanged 事件.请参阅 msdn.microsoft/en-us/library/system.windows.forms.datagridview.currentcelldirtystatechanged.aspx.
A colleague of mine recommends trapping the CurrentCellDirtyStateChanged event. See msdn.microsoft/en-us/library/system.windows.forms.datagridview.currentcelldirtystatechanged.aspx.
更多推荐
在 DataGridView 中触发复选框值更改事件
发布评论