DataGridViewRowEventArgs Klasa

Definicja

Dostarcza dane dla zdarzeń związanych z wierszem DataGridView .

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

Przykłady

Poniższy przykład kodu ilustruje użycie tego typu.

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

Uwagi

Klasa DataGridViewRowEventArgs udostępnia dane dla następujących DataGridView zdarzeń:

Konstruktory

DataGridViewRowEventArgs(DataGridViewRow)

Inicjuje nowe wystąpienie klasy DataGridViewRowEventArgs.

Właściwości

Row

DataGridViewRow Pobiera element skojarzony ze zdarzeniem.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy

Zobacz też