System.Web.UI.WebControls.DataList.SelectedIndex Property

Gets or sets the index of the selected item in the System.Web.UI.WebControls.DataList 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 DataList.SelectedIndex property to programmatically specify the selected item in the System.Web.UI.WebControls.DataList control. You can also use this property to determine the index of the selected item.

Note:

The DataList.SelectedIndex property is zero based.

To deselect an item, set the DataList.SelectedIndex property to -1.

The DataList.SelectedIndex property is stored in control state.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0