DataGridViewCellCancelEventArgs DataGridViewCellCancelEventArgs DataGridViewCellCancelEventArgs DataGridViewCellCancelEventArgs Class

Definition

Provides data for CellBeginEdit and RowValidating events.

public ref class DataGridViewCellCancelEventArgs : System::ComponentModel::CancelEventArgs
public class DataGridViewCellCancelEventArgs : System.ComponentModel.CancelEventArgs
type DataGridViewCellCancelEventArgs = class
    inherit CancelEventArgs
Public Class DataGridViewCellCancelEventArgs
Inherits CancelEventArgs
Inheritance
DataGridViewCellCancelEventArgsDataGridViewCellCancelEventArgsDataGridViewCellCancelEventArgsDataGridViewCellCancelEventArgs
Derived

Examples

The following code example illustrates the use of this type.

private void dataGridView1_CellBeginEdit(object sender,
    DataGridViewCellCancelEventArgs e)
{
    string msg = String.Format("Editing Cell at ({0}, {1})",
        e.ColumnIndex, e.RowIndex);
    this.Text = msg;
}

private void dataGridView1_CellEndEdit(object sender,
    DataGridViewCellEventArgs e)
{
    string msg = String.Format("Finished Editing Cell at ({0}, {1})",
        e.ColumnIndex, e.RowIndex);
    this.Text = msg;
}
Private Sub dataGridView1_CellBeginEdit(ByVal sender As Object, _
    ByVal e As DataGridViewCellCancelEventArgs) _
    Handles DataGridView1.CellBeginEdit

    Dim msg As String = _
        String.Format("Editing Cell at ({0}, {1})", _
        e.ColumnIndex, e.RowIndex)
    Me.Text = msg

End Sub

Private Sub dataGridView1_CellEndEdit(ByVal sender As Object, _
    ByVal e As DataGridViewCellEventArgs) _
    Handles DataGridView1.CellEndEdit

    Dim msg As String = _
        String.Format("Finished Editing Cell at ({0}, {1})", _
        e.ColumnIndex, e.RowIndex)
    Me.Text = msg

End Sub

Constructors

DataGridViewCellCancelEventArgs(Int32, Int32) DataGridViewCellCancelEventArgs(Int32, Int32) DataGridViewCellCancelEventArgs(Int32, Int32) DataGridViewCellCancelEventArgs(Int32, Int32)

Initializes a new instance of the DataGridViewCellCancelEventArgs class.

Properties

Cancel Cancel Cancel Cancel

Gets or sets a value indicating whether the event should be canceled.

(Inherited from CancelEventArgs)
ColumnIndex ColumnIndex ColumnIndex ColumnIndex

Gets the column index of the cell that the event occurs for.

RowIndex RowIndex RowIndex RowIndex

Gets the row index of the cell that the event occurs for.

Methods

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

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also