DataGridViewRowEventArgs.Row Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the DataGridViewRow associated with the event.
public:
property System::Windows::Forms::DataGridViewRow ^ Row { System::Windows::Forms::DataGridViewRow ^ get(); };
public System.Windows.Forms.DataGridViewRow Row { get; }
member this.Row : System.Windows.Forms.DataGridViewRow
Public ReadOnly Property Row As DataGridViewRow
Property Value
The DataGridViewRow associated with the event.
Examples
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
Applies to
See also
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา