开发者

DataGridView CheckboxColumn header check box synchronize with rows?

I have made a checkbox inside the header of checkbox column. It works fine when i check it all rows in the DataGridView gets checked. What I want to do is to uncheked the header cell checkbox when a single row in the DataGridView is unchecked. I tried putting code in the CellValueChanged event that sets the header checkbox state. The problem is that CellValueChanged is fired when current cell loses focus. So if I click two or 开发者_运维技巧three times in the cell nothing happens, but when e select next cell the event is fired and the header cell checkbox state is invalidated.


In CurrentCellDirtyStateChanged event call the datagridview's CommitEdit(DataGridViewErrorContexts.Commit) method. It commits the cell value and triggers the CellValueChanged event of corresponding cell.


tried CurrentCellDirtyStateChanged event?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜