# GetSelectedItems<T>()

> Gets tree data for the selected item indices.

## Definition

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

```csharp
public IEnumerable<TreeViewItemData<T>> GetSelectedItems<T>()
```

### Returns

| Type                                                                                                                  | Description                          |
| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------ |
| [IEnumerable\<TreeViewItemData\<T>>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) | The selected TreeViewItemData items. |
