# SetupParentsAndChildrenFromDepths(TreeViewItem, IList<TreeViewItem>)

> Utility method for initializing all the parent and children properties of the rows using the order and the depths values that have been set.

## Definition

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

> **Warning:**
>
> **Removed.** TreeView is now deprecated. You can likely now use TreeView\\\<int\\> instead and not think more about it. But if you were using that identifier to store EntityId data, you should instead opt to upgrade your TreeViews to use TreeView\\\<EntityId\\> to get the proper typing.

```csharp
protected static void SetupParentsAndChildrenFromDepths(TreeViewItem root, IList<TreeViewItem> rows)
```

### Parameters

**** (\[TreeViewItem]\(/engine/6000.7/script-reference/unityeditor/imgui/controls/treeviewitem)): The hidden root item.**** (\[IList\<TreeViewItem>]\(https\://learn.microsoft.com/dotnet/api/system.collections.generic.ilist-1)): TreeViewItems where only the depth property have been set.

### Remarks

Some tree data models are based on order and depth information only. This method can be called after creating all the rows to initalize the ‘parent’ and ‘children’ properties for each TreeViewItem in ‘rows’ based on the depth information for each item. This method assumes that the data presented in `rows` is in the order it should appear from top to bottom in the TreeView.

Additional Resources: [TreeView.SetupDepthsFromParentsAndChildren](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeview/setupdepthsfromparentsandchildren.md), [TreeView.BuildRoot](/engine/6000.7/script-reference/unityeditor/imgui/controls/treeview/buildroot.md).
