Delen via


Selector.SelectedIndex Property

Definition

Gets or sets the index of the selected item.

public:
 property int SelectedIndex { int get(); void set(int value); };
int SelectedIndex();

void SelectedIndex(int value);
public int SelectedIndex { get; set; }
var int32 = selector.selectedIndex;
selector.selectedIndex = int32;
Public Property SelectedIndex As Integer
<selector SelectedIndex="int" .../>

Property Value

Int32

int

The index of the selected item. The default is -1, which indicates that no item is selected.

Remarks

Some controls that are derived from Selector, like ListBox, ListView, and GridView, also support multi-selection. When multi-selection is enabled in those controls, use their SelectedItems property to get the selected item collection.

Applies to

See also