/// <summary> /// Clone method override. Required so CheckEventHandler property is cloned. /// Individual DataGridViewCells are cloned from the DataGridViewColumn.CellTemplate /// </summary> /// <returns></returns> public override object Clone() { DataGridViewEventCheckBoxCell clone = (DataGridViewEventCheckBoxCell)base.Clone(); clone.ContentClickEventHandler = ContentClickEventHandler; return(clone); }
/// <summary> /// Constructor for setting the OnContentClick event handler for the cell template. /// Note that the handler will be called for all clicks, even if the DataGridView is ReadOnly. /// For the "new" state of the checkbox, use the EditedFormattedValue property of the cell. /// </summary> /// <param name="handler">Event handler for OnContentClick.</param> /// <param name="threeState">True for three state check boxes, True, False, Indeterminate.</param> public DataGridViewEventCheckBoxColumn(EventHandler <DataGridViewCellEventArgs> handler, bool threeState) : base(threeState) { CellTemplate = new DataGridViewEventCheckBoxCell(handler, threeState); }