DataGridViewRowEventArgs.Row Property


Gets the DataGridViewRow associated with the event.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public DataGridViewRow Row { get; }

Property Value

Type: System.Windows.Forms.DataGridViewRow

The DataGridViewRow associated with the event.

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

.NET Framework
Available since 2.0
Return to top