DataGridViewRowPrePaintEventArgs::RowIndex Property

 

Gets the index of the current DataGridViewRow.

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

public:
property int RowIndex {
	int get();
}

Property Value

Type: System::Int32

The index of the current DataGridViewRow.

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.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: