# selectedIndices

> Returns the indices of selected items in the data source. Always returns an enumerable, even if no item is selected, or a single item is selected.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.UIElements](/engine/6000.3/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public IEnumerable<int> selectedIndices { get; }
```

### Remarks

In a tree, if a child item is collapsed, its index is not included in the selection. To get selected items regardless of whether they are collapsed or not, use [BaseVerticalCollectionView.selectedIds](/engine/6000.3/script-reference/unityengine/uielements/baseverticalcollectionview/selectedids.md) instead.
