System.Windows.Forms.DataGrid.CurrentRowIndex Property

Gets or sets index of the row that currently has focus.

Syntax

[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
[System.ComponentModel.Browsable(false)]
public int CurrentRowIndex { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Setting the DataGrid.CurrentRowIndex property to a value other than its current value scrolls the control so that the specified row is in view.

The DataGrid.CurrentRowIndex property enables you to iterate through a parent table's rows even if you are viewing the child table rows. For example, if you are viewing a child table, incrementing the DataGrid.CurrentRowIndex will cause the System.Windows.Forms.DataGrid to display the next set of records in the child table that are linked to the parent table.

If the user is viewing a parent table, or a table with no child relations, then the property returns the zero-based index of the current row.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0