일반적으로 DataGridView에서 Cell 값이 변경 되었을 때의 처리를 원할 경우 CellValueChanged 이벤트 핸들러를 사용하면 됩니다. 하지만 CheckBoxCell의 경우는 이 이벤트가 바로 발생하지가 않습니다. CheckBoxCell의 경우는 조금 다르게 처리를 해주어야 합니다.
// 직접 셀값이 변경됨을 알림
private void OnMacrosCurrentCellDirtyStateChanged(object sender, EventArgs e)
{
    DataGridView dvg = sender as DataGridView;
    if (null != dvg && dvg.IsCurrentCellDirty)
    {
        dvg.CommitEdit(DataGridViewDataErrorContexts.Commit);
    }
}

위의 이벤트 핸들러를 추가해주면 CheckBoxCell의 경우에도 값이 변경되었을때 CellValueChanged 이벤트 함수가 바로 호출되게 됩니다.

관련 링크 1 : MSDN - DataGridView.CellValueChanged Event
관련 링크 2 : MSDN - DataGridView.CurrentCellDirtyStateChanged Event

+ Recent posts