DataGridViewCheckBoxCell DataGridViewCheckBoxCell DataGridViewCheckBoxCell DataGridViewCheckBoxCell Class

Definition

Displays a check box user interface (UI) to use in a DataGridView control.

public ref class DataGridViewCheckBoxCell : System::Windows::Forms::DataGridViewCell, System::Windows::Forms::IDataGridViewEditingCell
public class DataGridViewCheckBoxCell : System.Windows.Forms.DataGridViewCell, System.Windows.Forms.IDataGridViewEditingCell
type DataGridViewCheckBoxCell = class
    inherit DataGridViewCell
    interface IDataGridViewEditingCell
Public Class DataGridViewCheckBoxCell
Inherits DataGridViewCell
Implements IDataGridViewEditingCell
Inheritance
Implements

Examples

The following code example uses a DataGridViewCheckBoxColumn to track which employees are in the office. The column is made up of DataGridViewCheckBoxCell objects. This example is part of a larger example available in the DataGridViewComboBoxColumn class overview topic.

private:
    void AddOutOfOfficeColumn()
    {
        DataGridViewCheckBoxColumn^ column = gcnew DataGridViewCheckBoxColumn();
        {
            column->HeaderText = ColumnName::OutOfOffice.ToString();
            column->Name = ColumnName::OutOfOffice.ToString();
            column->AutoSizeMode = 
                DataGridViewAutoSizeColumnMode::DisplayedCells;
            column->FlatStyle = FlatStyle::Standard;
            column->ThreeState = true;
            column->CellTemplate = gcnew DataGridViewCheckBoxCell();
            column->CellTemplate->Style->BackColor = Color::Beige;
        }

        DataGridView1->Columns->Insert(0, column);
    }
private void AddOutOfOfficeColumn()
{
    DataGridViewCheckBoxColumn column = new DataGridViewCheckBoxColumn();
    {
        column.HeaderText = ColumnName.OutOfOffice.ToString();
        column.Name = ColumnName.OutOfOffice.ToString();
        column.AutoSizeMode = 
            DataGridViewAutoSizeColumnMode.DisplayedCells;
        column.FlatStyle = FlatStyle.Standard;
        column.ThreeState = true;
        column.CellTemplate = new DataGridViewCheckBoxCell();
        column.CellTemplate.Style.BackColor = Color.Beige;
    }

    DataGridView1.Columns.Insert(0, column);
}
Private Sub AddOutOfOfficeColumn()
    Dim column As New DataGridViewCheckBoxColumn()
    With column
        .HeaderText = ColumnName.OutOfOffice.ToString()
        .Name = ColumnName.OutOfOffice.ToString()
        .AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells
        .FlatStyle = FlatStyle.Standard
        .CellTemplate = New DataGridViewCheckBoxCell()
        .CellTemplate.Style.BackColor = Color.Beige
    End With

    DataGridView1.Columns.Insert(0, column)
End Sub

Remarks

The DataGridViewCheckBoxCell class is a specialized type of DataGridViewCell used to display binary or ternary information presented through a check box UI. In the default binary mode, the cells can hold values of true or false. In ternary mode, the cells take on one of the CheckState values. The ThreeState property determines whether binary or ternary mode is in effect.

The DataGridViewCheckBoxColumn is the column type specialized to hold cells of this type. By default, the DataGridViewCheckBoxColumn.CellTemplate is initialized to a new DataGridViewCheckBoxCell. To pattern the cells within a column after an existing DataGridViewCheckBoxCell, set the column's CellTemplate property to the cell to use as a pattern.

The cell-related properties of the column are wrappers for the similarly-named properties of the template cell. Changing the property values of the template cell will affect only cells based on the template that are added after the change. Changing the cell-related property values of the column, however, will update the template cell and all other cells in the column, and refresh the column display if necessary.

When the current cell is a DataGridViewCheckBoxCell, the DataGridView.IsCurrentCellInEditMode property is always true.

Typically, check box cell values are intended either for storage, like any other data, or for performing bulk operations. If you want to respond immediately when users click a check box cell, you can handle the DataGridView.CellClick event, but this event occurs before the cell value is updated. If you need the new value at the time of the click, one option is to calculate what the expected value will be based on the current value. Another approach is to commit the change immediately, and handle the DataGridView.CellValueChanged event to respond to it. To commit the change when the cell is clicked, you must handle the DataGridView.CurrentCellDirtyStateChanged event. In the handler, if the current cell is a check box cell, call the DataGridView.CommitEdit method and pass in the Commit value.

Notes to Inheritors

When you derive from DataGridViewCheckBoxCell and add new properties to the derived class, be sure to override the Clone() method to copy the new properties during cloning operations. You should also call the base class's Clone() method so that the properties of the base class are copied to the new cell.

Constructors

DataGridViewCheckBoxCell() DataGridViewCheckBoxCell() DataGridViewCheckBoxCell() DataGridViewCheckBoxCell()

Initializes a new instance of the DataGridViewCheckBoxCell class to its default state.

DataGridViewCheckBoxCell(Boolean) DataGridViewCheckBoxCell(Boolean) DataGridViewCheckBoxCell(Boolean) DataGridViewCheckBoxCell(Boolean)

Initializes a new instance of the DataGridViewCheckBoxCell class, enabling binary or ternary state.

Properties

AccessibilityObject AccessibilityObject AccessibilityObject AccessibilityObject

Gets the DataGridViewCell.DataGridViewCellAccessibleObject assigned to the DataGridViewCell.

(Inherited from DataGridViewCell)
ColumnIndex ColumnIndex ColumnIndex ColumnIndex

Gets the column index for this cell.

(Inherited from DataGridViewCell)
ContentBounds ContentBounds ContentBounds ContentBounds

Gets the bounding rectangle that encloses the cell's content area.

(Inherited from DataGridViewCell)
ContextMenuStrip ContextMenuStrip ContextMenuStrip ContextMenuStrip

Gets or sets the shortcut menu associated with the cell.

(Inherited from DataGridViewCell)
DataGridView DataGridView DataGridView DataGridView

Gets the DataGridView control associated with this element.

(Inherited from DataGridViewElement)
DefaultNewRowValue DefaultNewRowValue DefaultNewRowValue DefaultNewRowValue

Gets the default value for a cell in the row for new records.

(Inherited from DataGridViewCell)
Displayed Displayed Displayed Displayed

Gets a value that indicates whether the cell is currently displayed on-screen.

(Inherited from DataGridViewCell)
EditedFormattedValue EditedFormattedValue EditedFormattedValue EditedFormattedValue

Gets the current, formatted value of the cell, regardless of whether the cell is in edit mode and the value has not been committed.

(Inherited from DataGridViewCell)
EditingCellFormattedValue EditingCellFormattedValue EditingCellFormattedValue EditingCellFormattedValue

Gets or sets the formatted value of the control hosted by the cell when it is in edit mode.

EditingCellValueChanged EditingCellValueChanged EditingCellValueChanged EditingCellValueChanged

Gets or sets a flag indicating that the value has been changed for this cell.

EditType EditType EditType EditType

Gets the type of the cell's hosted editing control.

ErrorIconBounds ErrorIconBounds ErrorIconBounds ErrorIconBounds

Gets the bounds of the error icon for the cell.

(Inherited from DataGridViewCell)
ErrorText ErrorText ErrorText ErrorText

Gets or sets the text describing an error condition associated with the cell.

(Inherited from DataGridViewCell)
FalseValue FalseValue FalseValue FalseValue

Gets or sets the underlying value corresponding to a cell value of false.

FlatStyle FlatStyle FlatStyle FlatStyle

Gets or sets the flat style appearance of the check box user interface (UI).

FormattedValue FormattedValue FormattedValue FormattedValue

Gets the value of the cell as formatted for display.

(Inherited from DataGridViewCell)
FormattedValueType FormattedValueType FormattedValueType FormattedValueType

Gets the type of the cell display value.

Frozen Frozen Frozen Frozen

Gets a value indicating whether the cell is frozen.

(Inherited from DataGridViewCell)
HasStyle HasStyle HasStyle HasStyle

Gets a value indicating whether the Style property has been set.

(Inherited from DataGridViewCell)
IndeterminateValue IndeterminateValue IndeterminateValue IndeterminateValue

Gets or sets the underlying value corresponding to an indeterminate or null cell value.

InheritedState InheritedState InheritedState InheritedState

Gets the current state of the cell as inherited from the state of its row and column.

(Inherited from DataGridViewCell)
InheritedStyle InheritedStyle InheritedStyle InheritedStyle

Gets the style currently applied to the cell.

(Inherited from DataGridViewCell)
IsInEditMode IsInEditMode IsInEditMode IsInEditMode

Gets a value indicating whether this cell is currently being edited.

(Inherited from DataGridViewCell)
OwningColumn OwningColumn OwningColumn OwningColumn

Gets the column that contains this cell.

(Inherited from DataGridViewCell)
OwningRow OwningRow OwningRow OwningRow

Gets the row that contains this cell.

(Inherited from DataGridViewCell)
PreferredSize PreferredSize PreferredSize PreferredSize

Gets the size, in pixels, of a rectangular area into which the cell can fit.

(Inherited from DataGridViewCell)
ReadOnly ReadOnly ReadOnly ReadOnly

Gets or sets a value indicating whether the cell's data can be edited.

(Inherited from DataGridViewCell)
Resizable Resizable Resizable Resizable

Gets a value indicating whether the cell can be resized.

(Inherited from DataGridViewCell)
RowIndex RowIndex RowIndex RowIndex

Gets the index of the cell's parent row.

(Inherited from DataGridViewCell)
Selected Selected Selected Selected

Gets or sets a value indicating whether the cell has been selected.

(Inherited from DataGridViewCell)
Size Size Size Size

Gets the size of the cell.

(Inherited from DataGridViewCell)
State State State State

Gets the user interface (UI) state of the element.

(Inherited from DataGridViewElement)
Style Style Style Style

Gets or sets the style for the cell.

(Inherited from DataGridViewCell)
Tag Tag Tag Tag

Gets or sets the object that contains supplemental data about the cell.

(Inherited from DataGridViewCell)
ThreeState ThreeState ThreeState ThreeState

Gets or sets a value indicating whether ternary mode has been enabled for the hosted check box control.

ToolTipText ToolTipText ToolTipText ToolTipText

Gets or sets the ToolTip text associated with this cell.

(Inherited from DataGridViewCell)
TrueValue TrueValue TrueValue TrueValue

Gets or sets the underlying value corresponding to a cell value of true.

Value Value Value Value

Gets or sets the value associated with this cell.

(Inherited from DataGridViewCell)
ValueType ValueType ValueType ValueType

Gets the data type of the values in the cell.

Visible Visible Visible Visible

Gets a value indicating whether the cell is in a row or column that has been hidden.

(Inherited from DataGridViewCell)

Methods

AdjustCellBorderStyle(DataGridViewAdvancedBorderStyle, DataGridViewAdvancedBorderStyle, Boolean, Boolean, Boolean, Boolean) AdjustCellBorderStyle(DataGridViewAdvancedBorderStyle, DataGridViewAdvancedBorderStyle, Boolean, Boolean, Boolean, Boolean) AdjustCellBorderStyle(DataGridViewAdvancedBorderStyle, DataGridViewAdvancedBorderStyle, Boolean, Boolean, Boolean, Boolean) AdjustCellBorderStyle(DataGridViewAdvancedBorderStyle, DataGridViewAdvancedBorderStyle, Boolean, Boolean, Boolean, Boolean)

Modifies the input cell border style according to the specified criteria.

(Inherited from DataGridViewCell)
BorderWidths(DataGridViewAdvancedBorderStyle) BorderWidths(DataGridViewAdvancedBorderStyle) BorderWidths(DataGridViewAdvancedBorderStyle) BorderWidths(DataGridViewAdvancedBorderStyle)

Returns a Rectangle that represents the widths of all the cell margins.

(Inherited from DataGridViewCell)
ClickUnsharesRow(DataGridViewCellEventArgs) ClickUnsharesRow(DataGridViewCellEventArgs) ClickUnsharesRow(DataGridViewCellEventArgs) ClickUnsharesRow(DataGridViewCellEventArgs)

Indicates whether the cell's row will be unshared when the cell is clicked.

(Inherited from DataGridViewCell)
Clone() Clone() Clone() Clone()

Creates an exact copy of this cell.

ContentClickUnsharesRow(DataGridViewCellEventArgs) ContentClickUnsharesRow(DataGridViewCellEventArgs) ContentClickUnsharesRow(DataGridViewCellEventArgs) ContentClickUnsharesRow(DataGridViewCellEventArgs)

Indicates whether the row containing the cell will be unshared when the cell content is clicked.

ContentDoubleClickUnsharesRow(DataGridViewCellEventArgs) ContentDoubleClickUnsharesRow(DataGridViewCellEventArgs) ContentDoubleClickUnsharesRow(DataGridViewCellEventArgs) ContentDoubleClickUnsharesRow(DataGridViewCellEventArgs)

Indicates whether the row containing the cell will be unshared when the cell content is double-clicked.

CreateAccessibilityInstance() CreateAccessibilityInstance() CreateAccessibilityInstance() CreateAccessibilityInstance()

Creates a new accessible object for the DataGridViewCheckBoxCell.

DetachEditingControl() DetachEditingControl() DetachEditingControl() DetachEditingControl()

Removes the cell's editing control from the DataGridView.

(Inherited from DataGridViewCell)
Dispose() Dispose() Dispose() Dispose()

Releases all resources used by the DataGridViewCell.

(Inherited from DataGridViewCell)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Releases the unmanaged resources used by the DataGridViewCell and optionally releases the managed resources.

(Inherited from DataGridViewCell)
DoubleClickUnsharesRow(DataGridViewCellEventArgs) DoubleClickUnsharesRow(DataGridViewCellEventArgs) DoubleClickUnsharesRow(DataGridViewCellEventArgs) DoubleClickUnsharesRow(DataGridViewCellEventArgs)

Indicates whether the cell's row will be unshared when the cell is double-clicked.

(Inherited from DataGridViewCell)
EnterUnsharesRow(Int32, Boolean) EnterUnsharesRow(Int32, Boolean) EnterUnsharesRow(Int32, Boolean) EnterUnsharesRow(Int32, Boolean)

Indicates whether the parent row will be unshared when the focus moves to the cell.

(Inherited from DataGridViewCell)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String) GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String) GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String) GetClipboardContent(Int32, Boolean, Boolean, Boolean, Boolean, String)

Retrieves the formatted value of the cell to copy to the Clipboard.

(Inherited from DataGridViewCell)
GetContentBounds(Graphics, DataGridViewCellStyle, Int32) GetContentBounds(Graphics, DataGridViewCellStyle, Int32) GetContentBounds(Graphics, DataGridViewCellStyle, Int32) GetContentBounds(Graphics, DataGridViewCellStyle, Int32)

Returns the bounding rectangle that encloses the cell's content area, which is calculated using the specified Graphics and cell style.

GetContentBounds(Int32) GetContentBounds(Int32) GetContentBounds(Int32) GetContentBounds(Int32)

Returns the bounding rectangle that encloses the cell's content area using a default Graphics and cell style currently in effect for the cell.

(Inherited from DataGridViewCell)
GetEditedFormattedValue(Int32, DataGridViewDataErrorContexts) GetEditedFormattedValue(Int32, DataGridViewDataErrorContexts) GetEditedFormattedValue(Int32, DataGridViewDataErrorContexts) GetEditedFormattedValue(Int32, DataGridViewDataErrorContexts)

Returns the current, formatted value of the cell, regardless of whether the cell is in edit mode and the value has not been committed.

(Inherited from DataGridViewCell)
GetEditingCellFormattedValue(DataGridViewDataErrorContexts) GetEditingCellFormattedValue(DataGridViewDataErrorContexts) GetEditingCellFormattedValue(DataGridViewDataErrorContexts) GetEditingCellFormattedValue(DataGridViewDataErrorContexts)

Gets the formatted value of the cell while it is in edit mode.

GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32) GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32) GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32) GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32)

Returns the bounding rectangle that encloses the cell's error icon, if one is displayed.

GetErrorText(Int32) GetErrorText(Int32) GetErrorText(Int32) GetErrorText(Int32)

Returns a string that represents the error for the cell.

(Inherited from DataGridViewCell)
GetFormattedValue(Object, Int32, DataGridViewCellStyle, TypeConverter, TypeConverter, DataGridViewDataErrorContexts) GetFormattedValue(Object, Int32, DataGridViewCellStyle, TypeConverter, TypeConverter, DataGridViewDataErrorContexts) GetFormattedValue(Object, Int32, DataGridViewCellStyle, TypeConverter, TypeConverter, DataGridViewDataErrorContexts) GetFormattedValue(Object, Int32, DataGridViewCellStyle, TypeConverter, TypeConverter, DataGridViewDataErrorContexts)

Gets the formatted value of the cell's data.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetInheritedContextMenuStrip(Int32) GetInheritedContextMenuStrip(Int32) GetInheritedContextMenuStrip(Int32) GetInheritedContextMenuStrip(Int32)

Gets the inherited shortcut menu for the current cell.

(Inherited from DataGridViewCell)
GetInheritedState(Int32) GetInheritedState(Int32) GetInheritedState(Int32) GetInheritedState(Int32)

Returns a value indicating the current state of the cell as inherited from the state of its row and column.

(Inherited from DataGridViewCell)
GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean)

Gets the style applied to the cell.

(Inherited from DataGridViewCell)
GetPreferredSize(Graphics, DataGridViewCellStyle, Int32, Size) GetPreferredSize(Graphics, DataGridViewCellStyle, Int32, Size) GetPreferredSize(Graphics, DataGridViewCellStyle, Int32, Size) GetPreferredSize(Graphics, DataGridViewCellStyle, Int32, Size)

Calculates the preferred size, in pixels, of the cell.

GetSize(Int32) GetSize(Int32) GetSize(Int32) GetSize(Int32)

Gets the size of the cell.

(Inherited from DataGridViewCell)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetValue(Int32) GetValue(Int32) GetValue(Int32) GetValue(Int32)

Gets the value of the cell.

(Inherited from DataGridViewCell)
InitializeEditingControl(Int32, Object, DataGridViewCellStyle) InitializeEditingControl(Int32, Object, DataGridViewCellStyle) InitializeEditingControl(Int32, Object, DataGridViewCellStyle) InitializeEditingControl(Int32, Object, DataGridViewCellStyle)

Initializes the control used to edit the cell.

(Inherited from DataGridViewCell)
KeyDownUnsharesRow(KeyEventArgs, Int32) KeyDownUnsharesRow(KeyEventArgs, Int32) KeyDownUnsharesRow(KeyEventArgs, Int32) KeyDownUnsharesRow(KeyEventArgs, Int32)

Indicates whether the row containing the cell is unshared when a key is pressed while the cell has focus.

KeyEntersEditMode(KeyEventArgs) KeyEntersEditMode(KeyEventArgs) KeyEntersEditMode(KeyEventArgs) KeyEntersEditMode(KeyEventArgs)

Determines if edit mode should be started based on the given key.

(Inherited from DataGridViewCell)
KeyPressUnsharesRow(KeyPressEventArgs, Int32) KeyPressUnsharesRow(KeyPressEventArgs, Int32) KeyPressUnsharesRow(KeyPressEventArgs, Int32) KeyPressUnsharesRow(KeyPressEventArgs, Int32)

Indicates whether a row will be unshared if a key is pressed while a cell in the row has focus.

(Inherited from DataGridViewCell)
KeyUpUnsharesRow(KeyEventArgs, Int32) KeyUpUnsharesRow(KeyEventArgs, Int32) KeyUpUnsharesRow(KeyEventArgs, Int32) KeyUpUnsharesRow(KeyEventArgs, Int32)

Indicates whether the row containing the cell is unshared when a key is released while the cell has focus.

LeaveUnsharesRow(Int32, Boolean) LeaveUnsharesRow(Int32, Boolean) LeaveUnsharesRow(Int32, Boolean) LeaveUnsharesRow(Int32, Boolean)

Indicates whether a row will be unshared when the focus leaves a cell in the row.

(Inherited from DataGridViewCell)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
MouseClickUnsharesRow(DataGridViewCellMouseEventArgs) MouseClickUnsharesRow(DataGridViewCellMouseEventArgs) MouseClickUnsharesRow(DataGridViewCellMouseEventArgs) MouseClickUnsharesRow(DataGridViewCellMouseEventArgs)

Indicates whether a row will be unshared if the user clicks a mouse button while the pointer is on a cell in the row.

(Inherited from DataGridViewCell)
MouseDoubleClickUnsharesRow(DataGridViewCellMouseEventArgs) MouseDoubleClickUnsharesRow(DataGridViewCellMouseEventArgs) MouseDoubleClickUnsharesRow(DataGridViewCellMouseEventArgs) MouseDoubleClickUnsharesRow(DataGridViewCellMouseEventArgs)

Indicates whether a row will be unshared if the user double-clicks a cell in the row.

(Inherited from DataGridViewCell)
MouseDownUnsharesRow(DataGridViewCellMouseEventArgs) MouseDownUnsharesRow(DataGridViewCellMouseEventArgs) MouseDownUnsharesRow(DataGridViewCellMouseEventArgs) MouseDownUnsharesRow(DataGridViewCellMouseEventArgs)

Indicates whether the row containing the cell will be unshared when the mouse button is pressed while the pointer is over the cell.

MouseEnterUnsharesRow(Int32) MouseEnterUnsharesRow(Int32) MouseEnterUnsharesRow(Int32) MouseEnterUnsharesRow(Int32)

Indicates whether the row containing the cell will be unshared when the mouse pointer moves over the cell.

MouseLeaveUnsharesRow(Int32) MouseLeaveUnsharesRow(Int32) MouseLeaveUnsharesRow(Int32) MouseLeaveUnsharesRow(Int32)

Indicates whether the row containing the cell will be unshared when the mouse pointer leaves the cell.

MouseMoveUnsharesRow(DataGridViewCellMouseEventArgs) MouseMoveUnsharesRow(DataGridViewCellMouseEventArgs) MouseMoveUnsharesRow(DataGridViewCellMouseEventArgs) MouseMoveUnsharesRow(DataGridViewCellMouseEventArgs)

Indicates whether a row will be unshared when the mouse pointer moves over a cell in the row.

(Inherited from DataGridViewCell)
MouseUpUnsharesRow(DataGridViewCellMouseEventArgs) MouseUpUnsharesRow(DataGridViewCellMouseEventArgs) MouseUpUnsharesRow(DataGridViewCellMouseEventArgs) MouseUpUnsharesRow(DataGridViewCellMouseEventArgs)

Indicates whether the row containing the cell will be unshared when the mouse button is released while the pointer is over the cell.

OnClick(DataGridViewCellEventArgs) OnClick(DataGridViewCellEventArgs) OnClick(DataGridViewCellEventArgs) OnClick(DataGridViewCellEventArgs)

Called when the cell is clicked.

(Inherited from DataGridViewCell)
OnContentClick(DataGridViewCellEventArgs) OnContentClick(DataGridViewCellEventArgs) OnContentClick(DataGridViewCellEventArgs) OnContentClick(DataGridViewCellEventArgs)

Called when the cell's contents are clicked.

OnContentDoubleClick(DataGridViewCellEventArgs) OnContentDoubleClick(DataGridViewCellEventArgs) OnContentDoubleClick(DataGridViewCellEventArgs) OnContentDoubleClick(DataGridViewCellEventArgs)

Called when the cell's contents are double-clicked.

OnDataGridViewChanged() OnDataGridViewChanged() OnDataGridViewChanged() OnDataGridViewChanged()

Called when the DataGridView property of the cell changes.

(Inherited from DataGridViewCell)
OnDoubleClick(DataGridViewCellEventArgs) OnDoubleClick(DataGridViewCellEventArgs) OnDoubleClick(DataGridViewCellEventArgs) OnDoubleClick(DataGridViewCellEventArgs)

Called when the cell is double-clicked.

(Inherited from DataGridViewCell)
OnEnter(Int32, Boolean) OnEnter(Int32, Boolean) OnEnter(Int32, Boolean) OnEnter(Int32, Boolean)

Called when the focus moves to a cell.

(Inherited from DataGridViewCell)
OnKeyDown(KeyEventArgs, Int32) OnKeyDown(KeyEventArgs, Int32) OnKeyDown(KeyEventArgs, Int32) OnKeyDown(KeyEventArgs, Int32)

Called when a character key is pressed while the focus is on a cell.

OnKeyPress(KeyPressEventArgs, Int32) OnKeyPress(KeyPressEventArgs, Int32) OnKeyPress(KeyPressEventArgs, Int32) OnKeyPress(KeyPressEventArgs, Int32)

Called when a key is pressed while the focus is on a cell.

(Inherited from DataGridViewCell)
OnKeyUp(KeyEventArgs, Int32) OnKeyUp(KeyEventArgs, Int32) OnKeyUp(KeyEventArgs, Int32) OnKeyUp(KeyEventArgs, Int32)

Called when a character key is released while the focus is on a cell.

OnLeave(Int32, Boolean) OnLeave(Int32, Boolean) OnLeave(Int32, Boolean) OnLeave(Int32, Boolean)

Called when the focus moves from a cell.

OnMouseClick(DataGridViewCellMouseEventArgs) OnMouseClick(DataGridViewCellMouseEventArgs) OnMouseClick(DataGridViewCellMouseEventArgs) OnMouseClick(DataGridViewCellMouseEventArgs)

Called when the user clicks a mouse button while the pointer is on a cell.

(Inherited from DataGridViewCell)
OnMouseDoubleClick(DataGridViewCellMouseEventArgs) OnMouseDoubleClick(DataGridViewCellMouseEventArgs) OnMouseDoubleClick(DataGridViewCellMouseEventArgs) OnMouseDoubleClick(DataGridViewCellMouseEventArgs)

Called when the user double-clicks a mouse button while the pointer is on a cell.

(Inherited from DataGridViewCell)
OnMouseDown(DataGridViewCellMouseEventArgs) OnMouseDown(DataGridViewCellMouseEventArgs) OnMouseDown(DataGridViewCellMouseEventArgs) OnMouseDown(DataGridViewCellMouseEventArgs)

Called when the mouse button is held down while the pointer is on a cell.

OnMouseEnter(Int32) OnMouseEnter(Int32) OnMouseEnter(Int32) OnMouseEnter(Int32)

Called when the mouse pointer moves over a cell.

(Inherited from DataGridViewCell)
OnMouseLeave(Int32) OnMouseLeave(Int32) OnMouseLeave(Int32) OnMouseLeave(Int32)

Called when the mouse pointer moves from a cell.

OnMouseMove(DataGridViewCellMouseEventArgs) OnMouseMove(DataGridViewCellMouseEventArgs) OnMouseMove(DataGridViewCellMouseEventArgs) OnMouseMove(DataGridViewCellMouseEventArgs)

Called when the mouse pointer moves within a cell.

OnMouseUp(DataGridViewCellMouseEventArgs) OnMouseUp(DataGridViewCellMouseEventArgs) OnMouseUp(DataGridViewCellMouseEventArgs) OnMouseUp(DataGridViewCellMouseEventArgs)

Called when the mouse button is released while the pointer is on a cell.

Paint(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Object, Object, String, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts) Paint(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Object, Object, String, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts) Paint(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Object, Object, String, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts) Paint(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Object, Object, String, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts)

Paints the current DataGridViewCheckBoxCell.

PaintBorder(Graphics, Rectangle, Rectangle, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle) PaintBorder(Graphics, Rectangle, Rectangle, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle) PaintBorder(Graphics, Rectangle, Rectangle, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle) PaintBorder(Graphics, Rectangle, Rectangle, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle)

Paints the border of the current DataGridViewCell.

(Inherited from DataGridViewCell)
PaintErrorIcon(Graphics, Rectangle, Rectangle, String) PaintErrorIcon(Graphics, Rectangle, Rectangle, String) PaintErrorIcon(Graphics, Rectangle, Rectangle, String) PaintErrorIcon(Graphics, Rectangle, Rectangle, String)

Paints the error icon of the current DataGridViewCell.

(Inherited from DataGridViewCell)
ParseFormattedValue(Object, DataGridViewCellStyle, TypeConverter, TypeConverter) ParseFormattedValue(Object, DataGridViewCellStyle, TypeConverter, TypeConverter) ParseFormattedValue(Object, DataGridViewCellStyle, TypeConverter, TypeConverter) ParseFormattedValue(Object, DataGridViewCellStyle, TypeConverter, TypeConverter)

Converts a value formatted for display to an actual cell value.

PositionEditingControl(Boolean, Boolean, Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean) PositionEditingControl(Boolean, Boolean, Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean) PositionEditingControl(Boolean, Boolean, Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean) PositionEditingControl(Boolean, Boolean, Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean)

Sets the location and size of the editing control hosted by a cell in the DataGridView control.

(Inherited from DataGridViewCell)
PositionEditingPanel(Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean) PositionEditingPanel(Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean) PositionEditingPanel(Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean) PositionEditingPanel(Rectangle, Rectangle, DataGridViewCellStyle, Boolean, Boolean, Boolean, Boolean)

Sets the location and size of the editing panel hosted by the cell, and returns the normal bounds of the editing control within the editing panel.

(Inherited from DataGridViewCell)
PrepareEditingCellForEdit(Boolean) PrepareEditingCellForEdit(Boolean) PrepareEditingCellForEdit(Boolean) PrepareEditingCellForEdit(Boolean)

This method is not meaningful for this type.

RaiseCellClick(DataGridViewCellEventArgs) RaiseCellClick(DataGridViewCellEventArgs) RaiseCellClick(DataGridViewCellEventArgs) RaiseCellClick(DataGridViewCellEventArgs)

Raises the CellClick event.

(Inherited from DataGridViewElement)
RaiseCellContentClick(DataGridViewCellEventArgs) RaiseCellContentClick(DataGridViewCellEventArgs) RaiseCellContentClick(DataGridViewCellEventArgs) RaiseCellContentClick(DataGridViewCellEventArgs)

Raises the CellContentClick event.

(Inherited from DataGridViewElement)
RaiseCellContentDoubleClick(DataGridViewCellEventArgs) RaiseCellContentDoubleClick(DataGridViewCellEventArgs) RaiseCellContentDoubleClick(DataGridViewCellEventArgs) RaiseCellContentDoubleClick(DataGridViewCellEventArgs)

Raises the CellContentDoubleClick event.

(Inherited from DataGridViewElement)
RaiseCellValueChanged(DataGridViewCellEventArgs) RaiseCellValueChanged(DataGridViewCellEventArgs) RaiseCellValueChanged(DataGridViewCellEventArgs) RaiseCellValueChanged(DataGridViewCellEventArgs)

Raises the CellValueChanged event.

(Inherited from DataGridViewElement)
RaiseDataError(DataGridViewDataErrorEventArgs) RaiseDataError(DataGridViewDataErrorEventArgs) RaiseDataError(DataGridViewDataErrorEventArgs) RaiseDataError(DataGridViewDataErrorEventArgs)

Raises the DataError event.

(Inherited from DataGridViewElement)
RaiseMouseWheel(MouseEventArgs) RaiseMouseWheel(MouseEventArgs) RaiseMouseWheel(MouseEventArgs) RaiseMouseWheel(MouseEventArgs)

Raises the MouseWheel event.

(Inherited from DataGridViewElement)
SetValue(Int32, Object) SetValue(Int32, Object) SetValue(Int32, Object) SetValue(Int32, Object)

Sets the value of the cell.

(Inherited from DataGridViewCell)
ToString() ToString() ToString() ToString()

Returns the string representation of the cell.

Applies to

See also