# SetExpandedRecursive(TIdentifier, bool)

> Expand or collapse all items under item with id.

## Definition

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

## SetExpandedRecursive(T, bool)

```csharp
public void SetExpandedRecursive(TIdentifier id, bool expanded)
```

### Parameters

**** (T): TreeViewItem ID.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Expanded state: true expands, false collapses.

### Remarks

This is also used internally when Alt/Option + clicking an foldout arrow of an item to expand/collapse the entire sub-tree under this item.
