public override int SelectedIndex { get; set; }
Public Overrides Property SelectedIndex As Integer
Get
Set
public:
virtual property int SelectedIndex {
int get () override;
void set (int value) override;
}
abstract SelectedIndex : int with get, set
override SelectedIndex : int with get, set
This is a zero-based index into the items collection. A value of -1 indicates that there is no current selection.
Setting a new index value will raise the TextChanged, SelectedItemChanged, and SelectedIndexChanged events in that order.
In DropDownList mode, if EnforceDefaultSelection is true, a SelectedIndex of -1 (no selection) is not allowed. Instead, the index specified by the DefaultSelection property is used instead. If the default value is outside the range of the data source, the last item is selected. For the DropDown and Simple modes, the EnforceDefaultSelection property is ignored as values can be entered that are not in the list of valid items.
ArgumentOutOfRangeException | This is thrown if the index is less than -1 or greater than the number of items in the collection. |