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?
精彩评论