DataGridViewRowPrePaintEventArgs::RowIndex Property
.NET Framework (current version)
Gets the index of the current DataGridViewRow.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The row index can be used to access the current row within a DataGridViewRowCollection.
The following code example demonstrates how to use the RowIndex property to access the current row. Although the code actually uses the DataGridViewRowPostPaintEventArgs::RowIndex property, this property is nearly identical to the RowIndex property of DataGridViewRowPrePaintEventArgs. The variable, e, is of type DataGridViewRowPostPaintEventArgs. This code example is part of a larger example provided in How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control.
.NET Framework
Available since 2.0
Available since 2.0
Show: