Redigera

Dela via


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
DataGridViewCellCancelEventArgs
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)

Initializes a new instance of the DataGridViewCellCancelEventArgs class.

Properties

Cancel

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

(Inherited from CancelEventArgs)
ColumnIndex

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

RowIndex

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

Methods

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also