共用方式為


DataGridViewRowEventArgs 類別

定義

提供資料列相關 DataGridView 事件的資料。

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

範例

下列程式碼範例說明此類型的用法。

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

備註

類別 DataGridViewRowEventArgs 提供下列 DataGridView 事件的資料:

建構函式

DataGridViewRowEventArgs(DataGridViewRow)

初始化 DataGridViewRowEventArgs 類別的新執行個體。

屬性

Row

取得與事件關聯的 DataGridViewRow

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱