DataGridViewButtonCell Class

Definition

Displays a button-like user interface (UI) for use in a DataGridView control.

public ref class DataGridViewButtonCell : System::Windows::Forms::DataGridViewCell
public class DataGridViewButtonCell : System.Windows.Forms.DataGridViewCell
type DataGridViewButtonCell = class
    inherit DataGridViewCell
Public Class DataGridViewButtonCell
Inherits DataGridViewCell
Inheritance

Examples

The following code example demonstrates how to use a DataGridViewButtonColumn to perform actions on particular rows. You can use similar code when working with individual DataGridViewButtonCell objects. In this example, a DataGridView.CellClick event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List.

public class Form1 : Form
{
    private List<Employee> employees = new List<Employee>();
    private List<Task> tasks = new List<Task>();
    private Button reportButton = new Button();
    private DataGridView dataGridView1 = new DataGridView();

    [STAThread]
    public static void Main()
    {
        Application.Run(new Form1());
    }

    public Form1()
    {
        dataGridView1.Dock = DockStyle.Fill;
        dataGridView1.AutoSizeColumnsMode = 
            DataGridViewAutoSizeColumnsMode.AllCells;
        reportButton.Text = "Generate Report";
        reportButton.Dock = DockStyle.Top;
        reportButton.Click += new EventHandler(reportButton_Click);

        Controls.Add(dataGridView1);
        Controls.Add(reportButton);
        Load += new EventHandler(Form1_Load);
        Text = "DataGridViewComboBoxColumn Demo";
    }

    // Initializes the data source and populates the DataGridView control.
    private void Form1_Load(object sender, EventArgs e)
    {
        PopulateLists();
        dataGridView1.AutoGenerateColumns = false;
        dataGridView1.DataSource = tasks;
        AddColumns();
    }

    // Populates the employees and tasks lists. 
    private void PopulateLists()
    {
        employees.Add(new Employee("Harry"));
        employees.Add(new Employee("Sally"));
        employees.Add(new Employee("Roy"));
        employees.Add(new Employee("Pris"));
        tasks.Add(new Task(1, employees[1]));
        tasks.Add(new Task(2));
        tasks.Add(new Task(3, employees[2]));
        tasks.Add(new Task(4));
    }

    // Configures columns for the DataGridView control.
    private void AddColumns()
    {
        DataGridViewTextBoxColumn idColumn = 
            new DataGridViewTextBoxColumn();
        idColumn.Name = "Task";
        idColumn.DataPropertyName = "Id";
        idColumn.ReadOnly = true;

        DataGridViewComboBoxColumn assignedToColumn = 
            new DataGridViewComboBoxColumn();

        // Populate the combo box drop-down list with Employee objects. 
        foreach (Employee e in employees) assignedToColumn.Items.Add(e);

        // Add "unassigned" to the drop-down list and display it for 
        // empty AssignedTo values or when the user presses CTRL+0. 
        assignedToColumn.Items.Add("unassigned");
        assignedToColumn.DefaultCellStyle.NullValue = "unassigned";

        assignedToColumn.Name = "Assigned To";
        assignedToColumn.DataPropertyName = "AssignedTo";
        assignedToColumn.AutoComplete = true;
        assignedToColumn.DisplayMember = "Name";
        assignedToColumn.ValueMember = "Self";

        // Add a button column. 
        DataGridViewButtonColumn buttonColumn = 
            new DataGridViewButtonColumn();
        buttonColumn.HeaderText = "";
        buttonColumn.Name = "Status Request";
        buttonColumn.Text = "Request Status";
        buttonColumn.UseColumnTextForButtonValue = true;

        dataGridView1.Columns.Add(idColumn);
        dataGridView1.Columns.Add(assignedToColumn);
        dataGridView1.Columns.Add(buttonColumn);

        // Add a CellClick handler to handle clicks in the button column.
        dataGridView1.CellClick +=
            new DataGridViewCellEventHandler(dataGridView1_CellClick);
    }

    // Reports on task assignments. 
    private void reportButton_Click(object sender, EventArgs e)
    {
        StringBuilder report = new StringBuilder();
        foreach (Task t in tasks)
        {
            String assignment = 
                t.AssignedTo == null ? 
                "unassigned" : "assigned to " + t.AssignedTo.Name;
            report.AppendFormat("Task {0} is {1}.", t.Id, assignment);
            report.Append(Environment.NewLine);
        }
        MessageBox.Show(report.ToString(), "Task Assignments");
    }

    // Calls the Employee.RequestStatus method.
    void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
    {
        // Ignore clicks that are not on button cells. 
        if (e.RowIndex < 0 || e.ColumnIndex !=
            dataGridView1.Columns["Status Request"].Index) return;

        // Retrieve the task ID.
        Int32 taskID = (Int32)dataGridView1[0, e.RowIndex].Value;

        // Retrieve the Employee object from the "Assigned To" cell.
        Employee assignedTo = dataGridView1.Rows[e.RowIndex]
            .Cells["Assigned To"].Value as Employee;

        // Request status through the Employee object if present. 
        if (assignedTo != null)
        {
            assignedTo.RequestStatus(taskID);
        }
        else
        {
            MessageBox.Show(String.Format(
                "Task {0} is unassigned.", taskID), "Status Request");
        }
    }
}
Public Class Form1
    Inherits Form

    Private employees As New List(Of Employee)
    Private tasks As New List(Of Task)
    Private WithEvents reportButton As New Button
    Private WithEvents dataGridView1 As New DataGridView

    <STAThread()> _
    Public Sub Main()
        Application.Run(New Form1)
    End Sub

    Sub New()
        dataGridView1.Dock = DockStyle.Fill
        dataGridView1.AutoSizeColumnsMode = _
            DataGridViewAutoSizeColumnsMode.AllCells
        reportButton.Text = "Generate Report"
        reportButton.Dock = DockStyle.Top

        Controls.Add(dataGridView1)
        Controls.Add(reportButton)
        Text = "DataGridViewComboBoxColumn Demo"
    End Sub

    ' Initializes the data source and populates the DataGridView control.
    Private Sub Form1_Load(ByVal sender As Object, _
        ByVal e As EventArgs) Handles Me.Load

        PopulateLists()
        dataGridView1.AutoGenerateColumns = False
        dataGridView1.DataSource = tasks
        AddColumns()

    End Sub

    ' Populates the employees and tasks lists. 
    Private Sub PopulateLists()
        employees.Add(New Employee("Harry"))
        employees.Add(New Employee("Sally"))
        employees.Add(New Employee("Roy"))
        employees.Add(New Employee("Pris"))
        tasks.Add(New Task(1, employees(1)))
        tasks.Add(New Task(2))
        tasks.Add(New Task(3, employees(2)))
        tasks.Add(New Task(4))
    End Sub

    ' Configures columns for the DataGridView control.
    Private Sub AddColumns()

        Dim idColumn As New DataGridViewTextBoxColumn()
        idColumn.Name = "Task"
        idColumn.DataPropertyName = "Id"
        idColumn.ReadOnly = True

        Dim assignedToColumn As New DataGridViewComboBoxColumn()

        ' Populate the combo box drop-down list with Employee objects. 
        For Each e As Employee In employees
            assignedToColumn.Items.Add(e)
        Next

        ' Add "unassigned" to the drop-down list and display it for 
        ' empty AssignedTo values or when the user presses CTRL+0. 
        assignedToColumn.Items.Add("unassigned")
        assignedToColumn.DefaultCellStyle.NullValue = "unassigned"

        assignedToColumn.Name = "Assigned To"
        assignedToColumn.DataPropertyName = "AssignedTo"
        assignedToColumn.AutoComplete = True
        assignedToColumn.DisplayMember = "Name"
        assignedToColumn.ValueMember = "Self"

        ' Add a button column. 
        Dim buttonColumn As New DataGridViewButtonColumn()
        buttonColumn.HeaderText = ""
        buttonColumn.Name = "Status Request"
        buttonColumn.Text = "Request Status"
        buttonColumn.UseColumnTextForButtonValue = True

        dataGridView1.Columns.Add(idColumn)
        dataGridView1.Columns.Add(assignedToColumn)
        dataGridView1.Columns.Add(buttonColumn)

    End Sub

    ' Reports on task assignments. 
    Private Sub reportButton_Click(ByVal sender As Object, _
        ByVal e As EventArgs) Handles reportButton.Click

        Dim report As New StringBuilder()
        For Each t As Task In tasks
            Dim assignment As String
            If t.AssignedTo Is Nothing Then
                assignment = "unassigned"
            Else
                assignment = "assigned to " + t.AssignedTo.Name
            End If
            report.AppendFormat("Task {0} is {1}.", t.Id, assignment)
            report.Append(Environment.NewLine)
        Next
        MessageBox.Show(report.ToString(), "Task Assignments")

    End Sub

    ' Calls the Employee.RequestStatus method.
    Private Sub dataGridView1_CellClick(ByVal sender As Object, _
        ByVal e As DataGridViewCellEventArgs) _
        Handles dataGridView1.CellClick

        ' Ignore clicks that are not on button cells. 
        If e.RowIndex < 0 OrElse Not e.ColumnIndex = _
            dataGridView1.Columns("Status Request").Index Then Return

        ' Retrieve the task ID.
        Dim taskID As Int32 = CInt(dataGridView1(0, e.RowIndex).Value)

        ' Retrieve the Employee object from the "Assigned To" cell.
        Dim assignedTo As Employee = TryCast(dataGridView1.Rows(e.RowIndex) _
            .Cells("Assigned To").Value, Employee)

        ' Request status through the Employee object if present. 
        If assignedTo IsNot Nothing Then
            assignedTo.RequestStatus(taskID)
        Else
            MessageBox.Show(String.Format( _
                "Task {0} is unassigned.", taskID), "Status Request")
        End If

    End Sub

End Class

Remarks

The DataGridViewButtonCell class is a specialized type of DataGridViewCell used to display a button-like UI.

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

To respond to user button clicks, handle the DataGridView.CellClick or DataGridView.CellContentClick event. In the event handler, you can use the DataGridViewCellEventArgs.ColumnIndex property to determine whether the click occurred a the button column. You can use the DataGridViewCellEventArgs.RowIndex property to determine whether the click occurred in a particular button cell.

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.

Note

When visual styles are enabled, the buttons in a button column are painted using a ButtonRenderer, and cell styles specified through properties such as DefaultCellStyle have no effect.

Notes to Inheritors

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

DataGridViewButtonCell()

Initializes a new instance of the DataGridViewButtonCell class.

Properties

AccessibilityObject

Gets the DataGridViewCell.DataGridViewCellAccessibleObject assigned to the DataGridViewCell.

(Inherited from DataGridViewCell)
ColumnIndex

Gets the column index for this cell.

(Inherited from DataGridViewCell)
ContentBounds

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

(Inherited from DataGridViewCell)
ContextMenuStrip

Gets or sets the shortcut menu associated with the cell.

(Inherited from DataGridViewCell)
DataGridView

Gets the DataGridView control associated with this element.

(Inherited from DataGridViewElement)
DefaultNewRowValue

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

(Inherited from DataGridViewCell)
Displayed

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

(Inherited from DataGridViewCell)
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)
EditType

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

ErrorIconBounds

Gets the bounds of the error icon for the cell.

(Inherited from DataGridViewCell)
ErrorText

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

(Inherited from DataGridViewCell)
FlatStyle

Gets or sets the style determining the button's appearance.

FormattedValue

Gets the value of the cell as formatted for display.

(Inherited from DataGridViewCell)
FormattedValueType

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

Frozen

Gets a value indicating whether the cell is frozen.

(Inherited from DataGridViewCell)
HasStyle

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

(Inherited from DataGridViewCell)
InheritedState

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

(Inherited from DataGridViewCell)
InheritedStyle

Gets the style currently applied to the cell.

(Inherited from DataGridViewCell)
IsInEditMode

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

(Inherited from DataGridViewCell)
OwningColumn

Gets the column that contains this cell.

(Inherited from DataGridViewCell)
OwningRow

Gets the row that contains this cell.

(Inherited from DataGridViewCell)
PreferredSize

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

(Inherited from DataGridViewCell)
ReadOnly

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

(Inherited from DataGridViewCell)
Resizable

Gets a value indicating whether the cell can be resized.

(Inherited from DataGridViewCell)
RowIndex

Gets the index of the cell's parent row.

(Inherited from DataGridViewCell)
Selected

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

(Inherited from DataGridViewCell)
Size

Gets the size of the cell.

(Inherited from DataGridViewCell)
State

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

(Inherited from DataGridViewElement)
Style

Gets or sets the style for the cell.

(Inherited from DataGridViewCell)
Tag

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

(Inherited from DataGridViewCell)
ToolTipText

Gets or sets the ToolTip text associated with this cell.

(Inherited from DataGridViewCell)
UseColumnTextForButtonValue

Gets or sets a value indicating whether the owning column's text will appear on the button displayed by the cell.

Value

Gets or sets the value associated with this cell.

(Inherited from DataGridViewCell)
ValueType

Gets or sets the data type of the values in the cell.

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)

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

(Inherited from DataGridViewCell)
BorderWidths(DataGridViewAdvancedBorderStyle)

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

(Inherited from DataGridViewCell)
ClickUnsharesRow(DataGridViewCellEventArgs)

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

(Inherited from DataGridViewCell)
Clone()

Creates an exact copy of this cell.

ContentClickUnsharesRow(DataGridViewCellEventArgs)

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

(Inherited from DataGridViewCell)
ContentDoubleClickUnsharesRow(DataGridViewCellEventArgs)

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

(Inherited from DataGridViewCell)
CreateAccessibilityInstance()

Creates a new accessible object for the DataGridViewButtonCell.

DetachEditingControl()

Removes the cell's editing control from the DataGridView.

(Inherited from DataGridViewCell)
Dispose()

Releases all resources used by the DataGridViewCell.

(Inherited from DataGridViewCell)
Dispose(Boolean)

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

(Inherited from DataGridViewCell)
DoubleClickUnsharesRow(DataGridViewCellEventArgs)

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

(Inherited from DataGridViewCell)
EnterUnsharesRow(Int32, Boolean)

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

(Inherited from DataGridViewCell)
Equals(Object)

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

(Inherited from Object)
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)

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

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)

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)
GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32)

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

GetErrorText(Int32)

Returns a string that represents the error for the cell.

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

Gets the value of the cell as formatted for display.

(Inherited from DataGridViewCell)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetInheritedContextMenuStrip(Int32)

Gets the inherited shortcut menu for the current cell.

(Inherited from DataGridViewCell)
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)

Gets the style applied to the cell.

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

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

GetSize(Int32)

Gets the size of the cell.

(Inherited from DataGridViewCell)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
GetValue(Int32)

Retrieves the text associated with the button.

InitializeEditingControl(Int32, Object, DataGridViewCellStyle)

Initializes the control used to edit the cell.

(Inherited from DataGridViewCell)
KeyDownUnsharesRow(KeyEventArgs, Int32)

Indicates whether a row is unshared if a key is pressed while the focus is on a cell in the row.

KeyEntersEditMode(KeyEventArgs)

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

(Inherited from DataGridViewCell)
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)

Indicates whether a row is unshared when a key is released while the focus is on a cell in the row.

LeaveUnsharesRow(Int32, Boolean)

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

(Inherited from DataGridViewCell)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
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)

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

(Inherited from DataGridViewCell)
MouseDownUnsharesRow(DataGridViewCellMouseEventArgs)

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

MouseEnterUnsharesRow(Int32)

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

MouseLeaveUnsharesRow(Int32)

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

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)

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

OnClick(DataGridViewCellEventArgs)

Called when the cell is clicked.

(Inherited from DataGridViewCell)
OnContentClick(DataGridViewCellEventArgs)

Called when the cell's contents are clicked.

(Inherited from DataGridViewCell)
OnContentDoubleClick(DataGridViewCellEventArgs)

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

(Inherited from DataGridViewCell)
OnDataGridViewChanged()

Called when the DataGridView property of the cell changes.

(Inherited from DataGridViewCell)
OnDoubleClick(DataGridViewCellEventArgs)

Called when the cell is double-clicked.

(Inherited from DataGridViewCell)
OnEnter(Int32, Boolean)

Called when the focus moves to a cell.

(Inherited from DataGridViewCell)
OnKeyDown(KeyEventArgs, Int32)

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

OnKeyPress(KeyPressEventArgs, Int32)

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

(Inherited from DataGridViewCell)
OnKeyUp(KeyEventArgs, Int32)

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

OnLeave(Int32, Boolean)

Called when the focus moves from the cell.

OnMouseClick(DataGridViewCellMouseEventArgs)

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

(Inherited from DataGridViewCell)
OnMouseDoubleClick(DataGridViewCellMouseEventArgs)

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

(Inherited from DataGridViewCell)
OnMouseDown(DataGridViewCellMouseEventArgs)

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

OnMouseEnter(Int32)

Called when the mouse pointer moves over a cell.

(Inherited from DataGridViewCell)
OnMouseLeave(Int32)

Called when the mouse pointer moves out of the cell.

OnMouseMove(DataGridViewCellMouseEventArgs)

Called when the mouse pointer moves while it is over the cell.

OnMouseUp(DataGridViewCellMouseEventArgs)

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

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

Paints the current DataGridViewButtonCell.

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

Paints the border of the current DataGridViewCell.

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

Paints the error icon of the current DataGridViewCell.

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

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

(Inherited from DataGridViewCell)
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)

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)
RaiseCellClick(DataGridViewCellEventArgs)

Raises the CellClick event.

(Inherited from DataGridViewElement)
RaiseCellContentClick(DataGridViewCellEventArgs)

Raises the CellContentClick event.

(Inherited from DataGridViewElement)
RaiseCellContentDoubleClick(DataGridViewCellEventArgs)

Raises the CellContentDoubleClick event.

(Inherited from DataGridViewElement)
RaiseCellValueChanged(DataGridViewCellEventArgs)

Raises the CellValueChanged event.

(Inherited from DataGridViewElement)
RaiseDataError(DataGridViewDataErrorEventArgs)

Raises the DataError event.

(Inherited from DataGridViewElement)
RaiseMouseWheel(MouseEventArgs)

Raises the MouseWheel event.

(Inherited from DataGridViewElement)
SetValue(Int32, Object)

Sets the value of the cell.

(Inherited from DataGridViewCell)
ToString()

Returns the string representation of the cell.

Applies to

See also