SelectedIndex Property (SelectionList)

Returns the index of the selected item. The default value is –1.

public int SelectedIndex {
   get,
   set
}

Remarks

If the control is in multiple selection mode, this property returns the index of the first selected item. The selected index cannot be set declaratively; use the Selected property of a list item instead. Set the SelectedIndex to –1 to clear the selection. This is useful when you want to dynamically remove items from the list.

See Also

Applies to: SelectionList Class