DataGrid::SelectedIndex Property
.NET Framework (current version)
Gets or sets the index of the selected item in the DataGrid control.
Assembly: System.Web (in System.Web.dll)
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | The specified index is less than -1. |
The following code example demonstrates how to use the SelectedIndex property to determine the index number of the selected item in the DataGrid control. It also shows how to select and deselect an item programmatically.
.NET Framework
Available since 1.1
Available since 1.1
Show: