DataGridViewRowEventArgs DataGridViewRowEventArgs DataGridViewRowEventArgs DataGridViewRowEventArgs Class

定义

为与行相关的 DataGridView 事件提供数据。Provides data for row-related DataGridView events.

public ref class DataGridViewRowEventArgs : EventArgs
public class DataGridViewRowEventArgs : EventArgs
type DataGridViewRowEventArgs = class
    inherit EventArgs
Public Class DataGridViewRowEventArgs
Inherits EventArgs
继承
DataGridViewRowEventArgsDataGridViewRowEventArgsDataGridViewRowEventArgsDataGridViewRowEventArgs

示例

下面的代码示例演示如何使用此类型。The following code example illustrates the use of this type.

private void dataGridView1_DefaultValuesNeeded(object sender,
    System.Windows.Forms.DataGridViewRowEventArgs e)
{
    e.Row.Cells["Region"].Value = "WA";
    e.Row.Cells["City"].Value = "Redmond";
    e.Row.Cells["PostalCode"].Value = "98052-6399";
    e.Row.Cells["Country"].Value = "USA";
    e.Row.Cells["CustomerID"].Value = NewCustomerId();
}
Private Sub dataGridView1_DefaultValuesNeeded(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) _
    Handles dataGridView1.DefaultValuesNeeded

    With e.Row
        .Cells("Region").Value = "WA"
        .Cells("City").Value = "Redmond"
        .Cells("PostalCode").Value = "98052-6399"
        .Cells("Country").Value = "USA"
        .Cells("CustomerID").Value = NewCustomerId()
    End With

End Sub

注解

类为以下DataGridView事件提供数据: DataGridViewRowEventArgsThe DataGridViewRowEventArgs class provides data for the following DataGridView events:

构造函数

DataGridViewRowEventArgs(DataGridViewRow) DataGridViewRowEventArgs(DataGridViewRow) DataGridViewRowEventArgs(DataGridViewRow) DataGridViewRowEventArgs(DataGridViewRow)

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

属性

Row Row Row Row

获取与该事件关联的 DataGridViewRowGets the DataGridViewRow associated with the event.

方法

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)

适用于

另请参阅