BulletedList::SelectedIndex Property
Gets or sets the zero-based index of the currently selected item in a BulletedList control.
Assembly: System.Web (in System.Web.dll)
public: [BindableAttribute(false)] property int SelectedIndex { virtual int get() override; virtual void set(int value) override; }
| Exception | Condition |
|---|---|
| NotSupportedException | An attempt was made to assign a value to the SelectedIndex. |
In the base class, ListControl, the SelectedIndex property returns a zero-based index of the currently selected item. The default is -1, which indicates that nothing is selected. The SelectedIndex property is not applicable to the BulletedList control.
Note When you use the get accessor for the SelectedIndex property, it always returns -1. An attempt to use the set accessor for the SelectedIndex property raises a NotSupportedException.
Use the event data of the BulletedListEventArgs class to determine the index of the link button in a BulletedList control that was clicked.
This property is not bindable in visual designers, but is bindable at runtime. For more information, see BindableAttribute.
Available since 2.0