System.Web.UI.WebControls.GridView.SelectedIndex Property

Gets or sets the index of the selected row in a System.Web.UI.WebControls.GridView control.

Syntax

[System.ComponentModel.DefaultValue(-1)]
[System.ComponentModel.Bindable(true)]
public virtual int SelectedIndex { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the GridView.SelectedIndex property to determine the index of the currently selected row in a System.Web.UI.WebControls.GridView control. You can also use this property to programmatically select a row in the control. To clear the selection of a row, set this property to -1. The appearance of the currently selected row can be customized by using the GridView.SelectedRowStyle property. To access the currently selected row, use the GridView.SelectedRow property.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0