# SetSelection

> Set the selected items of the TreeView.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.7/script-reference/unityeditor/imgui/controls.md)
* **Assembly:** UnityEditor.CoreModule

## SetSelection(IList\<T>)

Set the selected items of the TreeView.

```csharp
public void SetSelection(IList<TIdentifier> selectedIDs)
```

### Parameters

**** (\[IList\<T>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)): TreeViewItem IDs.

### Remarks

Additional Resources: [TreeViewSelectionOptions](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeviewselectionoptions.md).

## SetSelection(IList\<T>, TreeViewSelectionOptions)

Set the selected items of the TreeView.

```csharp
public void SetSelection(IList<TIdentifier> selectedIDs, TreeViewSelectionOptions options)
```

### Parameters

**** (\[IList\<T>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)): TreeViewItem IDs.**** (\[TreeViewSelectionOptions]\(/engine/6000.7/script-reference/unityeditor/imgui/controls/treeviewselectionoptions)): Options for extra logic performed after the selection. See [TreeViewSelectionOptions](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeviewselectionoptions.md).

### Remarks

Additional Resources: [TreeViewSelectionOptions](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeviewselectionoptions.md).
