DataGridViewCell DataGridViewCell DataGridViewCell DataGridViewCell Class

Definition

Represents an individual cell in a DataGridView control.

public ref class DataGridViewCell abstract : System::Windows::Forms::DataGridViewElement, ICloneable, IDisposable
[System.ComponentModel.TypeConverter(typeof(System.Windows.Forms.DataGridViewCellConverter))]
public abstract class DataGridViewCell : System.Windows.Forms.DataGridViewElement, ICloneable, IDisposable
type DataGridViewCell = class
    inherit DataGridViewElement
    interface ICloneable
    interface IDisposable
Public MustInherit Class DataGridViewCell
Inherits DataGridViewElement
Implements ICloneable, IDisposable
Inheritance
Derived
Attributes
Implements

Examples

The following code example illustrates the use of this type. For more information about this example, see How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control.

// Sets the ToolTip text for cells in the Rating column.
void dataGridView1_CellFormatting(Object^ /*sender*/, 
    DataGridViewCellFormattingEventArgs^ e)
{
    if ( (e->ColumnIndex == this->dataGridView1->Columns["Rating"]->Index)
        && e->Value != nullptr )
    {
        DataGridViewCell^ cell = 
            this->dataGridView1->Rows[e->RowIndex]->Cells[e->ColumnIndex];
        if (e->Value->Equals("*"))
        {                
            cell->ToolTipText = "very bad";
        }
        else if (e->Value->Equals("**"))
        {
            cell->ToolTipText = "bad";
        }
        else if (e->Value->Equals("***"))
        {
            cell->ToolTipText = "good";
        }
        else if (e->Value->Equals("****"))
        {
            cell->ToolTipText = "very good";
        }
    }
}
// Sets the ToolTip text for cells in the Rating column.
void dataGridView1_CellFormatting(object sender, 
    DataGridViewCellFormattingEventArgs e)
{
    if ( (e.ColumnIndex == this.dataGridView1.Columns["Rating"].Index)
        && e.Value != null )
    {
        DataGridViewCell cell = 
            this.dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
        if (e.Value.Equals("*"))
        {                
            cell.ToolTipText = "very bad";
        }
        else if (e.Value.Equals("**"))
        {
            cell.ToolTipText = "bad";
        }
        else if (e.Value.Equals("***"))
        {
            cell.ToolTipText = "good";
        }
        else if (e.Value.Equals("****"))
        {
            cell.ToolTipText = "very good";
        }
    }
}
' Sets the ToolTip text for cells in the Rating column.
Sub dataGridView1_CellFormatting(ByVal sender As Object, _
    ByVal e As DataGridViewCellFormattingEventArgs) _
    Handles dataGridView1.CellFormatting

    If e.ColumnIndex = Me.dataGridView1.Columns("Rating").Index _
        AndAlso (e.Value IsNot Nothing) Then

        With Me.dataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex)

            If e.Value.Equals("*") Then
                .ToolTipText = "very bad"
            ElseIf e.Value.Equals("**") Then
                .ToolTipText = "bad"
            ElseIf e.Value.Equals("***") Then
                .ToolTipText = "good"
            ElseIf e.Value.Equals("****") Then
                .ToolTipText = "very good"
            End If

        End With

    End If

End Sub 'dataGridView1_CellFormatting

Remarks

The DataGridViewCell class represents an individual cell in a DataGridView control. You can retrieve cells through the Cells collection of a DataGridViewRow.

The row and column for a DataGridViewCell identify the cell's location in the DataGridView. A typical cell contains data specific to the row and column in which it is contained. The cell can be customized in a number of ways by setting its properties and handling the events associated with it.

Notes to Inheritors

When you derive from DataGridViewCell 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

DataGridViewCell() DataGridViewCell() DataGridViewCell() DataGridViewCell()

Initializes a new instance of the DataGridViewCell class.

Properties

AccessibilityObject AccessibilityObject AccessibilityObject AccessibilityObject

Gets the DataGridViewCell.DataGridViewCellAccessibleObject assigned to the DataGridViewCell.

ColumnIndex ColumnIndex ColumnIndex ColumnIndex

Gets the column index for this cell.

ContentBounds ContentBounds ContentBounds ContentBounds

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

ContextMenuStrip ContextMenuStrip ContextMenuStrip ContextMenuStrip

Gets or sets the shortcut menu associated with the cell.

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.

Displayed Displayed Displayed Displayed

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

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.

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.

ErrorText ErrorText ErrorText ErrorText

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

FormattedValue FormattedValue FormattedValue FormattedValue

Gets the value of the cell as formatted for display.

FormattedValueType FormattedValueType FormattedValueType FormattedValueType

Gets the type of the formatted value associated with the cell.

Frozen Frozen Frozen Frozen

Gets a value indicating whether the cell is frozen.

HasStyle HasStyle HasStyle HasStyle

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

InheritedState InheritedState InheritedState InheritedState

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

InheritedStyle InheritedStyle InheritedStyle InheritedStyle

Gets the style currently applied to the cell.

IsInEditMode IsInEditMode IsInEditMode IsInEditMode

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

OwningColumn OwningColumn OwningColumn OwningColumn

Gets the column that contains this cell.

OwningRow OwningRow OwningRow OwningRow

Gets the row that contains this cell.

PreferredSize PreferredSize PreferredSize PreferredSize

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

ReadOnly ReadOnly ReadOnly ReadOnly

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

Resizable Resizable Resizable Resizable

Gets a value indicating whether the cell can be resized.

RowIndex RowIndex RowIndex RowIndex

Gets the index of the cell's parent row.

Selected Selected Selected Selected

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

Size Size Size Size

Gets the size of the cell.

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.

Tag Tag Tag Tag

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

ToolTipText ToolTipText ToolTipText ToolTipText

Gets or sets the ToolTip text associated with this cell.

Value Value Value Value

Gets or sets the value associated with this cell.

ValueType ValueType ValueType ValueType

Gets or sets 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.

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.

BorderWidths(DataGridViewAdvancedBorderStyle) BorderWidths(DataGridViewAdvancedBorderStyle) BorderWidths(DataGridViewAdvancedBorderStyle) BorderWidths(DataGridViewAdvancedBorderStyle)

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

ClickUnsharesRow(DataGridViewCellEventArgs) ClickUnsharesRow(DataGridViewCellEventArgs) ClickUnsharesRow(DataGridViewCellEventArgs) ClickUnsharesRow(DataGridViewCellEventArgs)

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

Clone() Clone() Clone() Clone()

Creates an exact copy of this cell.

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

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

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

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

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

Creates a new accessible object for the DataGridViewCell.

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

Removes the cell's editing control from the DataGridView.

Dispose() Dispose() Dispose() Dispose()

Releases all resources used by the DataGridViewCell.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

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

DoubleClickUnsharesRow(DataGridViewCellEventArgs) DoubleClickUnsharesRow(DataGridViewCellEventArgs) DoubleClickUnsharesRow(DataGridViewCellEventArgs) DoubleClickUnsharesRow(DataGridViewCellEventArgs)

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

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.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
Finalize() Finalize() Finalize() Finalize()

Releases the unmanaged resources and performs other cleanup operations before the DataGridViewCell is reclaimed by garbage collection.

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.

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.

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.

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.

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 value of the cell as formatted for display.

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.

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.

GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean) GetInheritedStyle(DataGridViewCellStyle, Int32, Boolean)

Gets the style applied to the cell.

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.

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.

InitializeEditingControl(Int32, Object, DataGridViewCellStyle) InitializeEditingControl(Int32, Object, DataGridViewCellStyle) InitializeEditingControl(Int32, Object, DataGridViewCellStyle) InitializeEditingControl(Int32, Object, DataGridViewCellStyle)

Initializes the control used to edit the cell.

KeyDownUnsharesRow(KeyEventArgs, Int32) KeyDownUnsharesRow(KeyEventArgs, Int32) KeyDownUnsharesRow(KeyEventArgs, Int32) KeyDownUnsharesRow(KeyEventArgs, Int32)

Indicates whether the parent row is unshared if the user presses a key while the focus is on the cell.

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

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

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.

KeyUpUnsharesRow(KeyEventArgs, Int32) KeyUpUnsharesRow(KeyEventArgs, Int32) KeyUpUnsharesRow(KeyEventArgs, Int32) KeyUpUnsharesRow(KeyEventArgs, Int32)

Indicates whether the parent row is unshared when the user releases a key while the focus is on the cell.

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.

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags) MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags) MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags) MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags)

Gets the height, in pixels, of the specified text, given the specified characteristics.

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean) MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean) MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean) MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean)

Gets the height, in pixels, of the specified text, given the specified characteristics. Also indicates whether the required width is greater than the specified maximum width.

MeasureTextPreferredSize(Graphics, String, Font, Single, TextFormatFlags) MeasureTextPreferredSize(Graphics, String, Font, Single, TextFormatFlags) MeasureTextPreferredSize(Graphics, String, Font, Single, TextFormatFlags) MeasureTextPreferredSize(Graphics, String, Font, Single, TextFormatFlags)

Gets the ideal height and width of the specified text given the specified characteristics.

MeasureTextSize(Graphics, String, Font, TextFormatFlags) MeasureTextSize(Graphics, String, Font, TextFormatFlags) MeasureTextSize(Graphics, String, Font, TextFormatFlags) MeasureTextSize(Graphics, String, Font, TextFormatFlags)

Gets the height and width of the specified text given the specified characteristics.

MeasureTextWidth(Graphics, String, Font, Int32, TextFormatFlags) MeasureTextWidth(Graphics, String, Font, Int32, TextFormatFlags) MeasureTextWidth(Graphics, String, Font, Int32, TextFormatFlags) MeasureTextWidth(Graphics, String, Font, Int32, TextFormatFlags)

Gets the width, in pixels, of the specified text given the specified characteristics.

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.

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.

MouseDownUnsharesRow(DataGridViewCellMouseEventArgs) MouseDownUnsharesRow(DataGridViewCellMouseEventArgs) MouseDownUnsharesRow(DataGridViewCellMouseEventArgs) MouseDownUnsharesRow(DataGridViewCellMouseEventArgs)

Indicates whether a row will be unshared when the user holds down a mouse button while the pointer is on a cell in the row.

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

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

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

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

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.

MouseUpUnsharesRow(DataGridViewCellMouseEventArgs) MouseUpUnsharesRow(DataGridViewCellMouseEventArgs) MouseUpUnsharesRow(DataGridViewCellMouseEventArgs) MouseUpUnsharesRow(DataGridViewCellMouseEventArgs)

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

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

Called when the cell is clicked.

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.

OnDoubleClick(DataGridViewCellEventArgs) OnDoubleClick(DataGridViewCellEventArgs) OnDoubleClick(DataGridViewCellEventArgs) OnDoubleClick(DataGridViewCellEventArgs)

Called when the cell is double-clicked.

OnEnter(Int32, Boolean) OnEnter(Int32, Boolean) OnEnter(Int32, Boolean) OnEnter(Int32, Boolean)

Called when the focus moves to a cell.

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.

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.

OnMouseDoubleClick(DataGridViewCellMouseEventArgs) OnMouseDoubleClick(DataGridViewCellMouseEventArgs) OnMouseDoubleClick(DataGridViewCellMouseEventArgs) OnMouseDoubleClick(DataGridViewCellMouseEventArgs)

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

OnMouseDown(DataGridViewCellMouseEventArgs) OnMouseDown(DataGridViewCellMouseEventArgs) OnMouseDown(DataGridViewCellMouseEventArgs) OnMouseDown(DataGridViewCellMouseEventArgs)

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

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

Called when the mouse pointer moves over a cell.

OnMouseLeave(Int32) OnMouseLeave(Int32) OnMouseLeave(Int32) OnMouseLeave(Int32)

Called when the mouse pointer leaves the 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 user releases a mouse button 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 DataGridViewCell.

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.

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.

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.

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.

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.

ToString() ToString() ToString() ToString()

Returns a string that describes the current object.

Applies to

See also