DropDownList.SelectedIndex Property
.NET Framework 2.0
Gets or sets the index of the selected item in the DropDownList control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
public: virtual property int SelectedIndex { int get () override; void set (int value) override; }
/** @property */ public int get_SelectedIndex () /** @property */ public void set_SelectedIndex (int value)
public override function get SelectedIndex () : int public override function set SelectedIndex (value : int)
Property Value
The index of the selected item in the DropDownList control. The default value is 0, which selects the first item in the list.Use the SelectedIndex property to programmatically specify or determine the index of the selected item from the DropDownList control. An item is always selected in the DropDownList control. You cannot clear the selection from every item in the list at the same time.
Note |
|---|
| The indexes for the items in the DropDownList control are zero-based. |
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
Community Additions
ADD
Show:
Note