DataGridViewCellCancelEventArgs DataGridViewCellCancelEventArgs DataGridViewCellCancelEventArgs DataGridViewCellCancelEventArgs Class

定义

CellBeginEditRowValidating 事件提供数据。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
继承
DataGridViewCellCancelEventArgsDataGridViewCellCancelEventArgsDataGridViewCellCancelEventArgsDataGridViewCellCancelEventArgs
派生

示例

下面的代码示例演示如何使用此类型。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

构造函数

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

初始化 DataGridViewCellCancelEventArgs 类的新实例。Initializes a new instance of the DataGridViewCellCancelEventArgs class.

属性

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.

方法

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

获取当前实例的 TypeGets the Type of the current instance.

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

创建当前 Object 的浅表副本。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)

适用于

另请参阅