Table of Contents

Property SelectedIndices

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

SelectedIndices

Gets a collection that contains the zero-based indexes of all currently selected items in the control.

IReadOnlyList<int> SelectedIndices { get; set; }

Property Value

IReadOnlyList<int>

An IReadOnlyList<T> containing the indexes of the currently selected items in the control. If no items are currently selected, an empty IReadOnlyList<T> is returned.

Remarks

For a multiple-selection control, this property returns a collection containing the indexes to all items that are selected in the control. For a single-selection control, this property returns a collection containing a single element containing the index of the only selected item in the control.

There are a number of ways to reference selected items. Instead of using the SelectedIndices property to obtain the index position of the currently selected item in a single-selection control, you can use the SelectedIndex property. If you want to obtain the item that is currently selected in the control, instead of the index position of the item, use the SelectedItem property. In addition, you can use the SelectedItems property if you want to obtain all the selected items in a multiple-selection control.

See Also