# FindItem(int, TreeViewItem)

> Finds a TreeViewItem by an ID.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.5/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 InstanceID data, you should instead opt to upgrade your TreeViews to use TreeView\\\<InstanceID\\> to get the proper typing.

```csharp
protected TreeViewItem FindItem(int id, TreeViewItem searchFromThisItem)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Find the TreeViewItem with this ID.**** (\[TreeViewItem]\(/engine/6000.5/script-reference/unityeditor/imgui/controls/treeviewitem)): Sets the search to start from an item. Use 'rootItem' to search the entire tree.

### Returns

| Type                                                                                       | Description                                                                      |
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
| [TreeViewItem](/engine/6000.5/script-reference/unityeditor/imgui/controls/treeviewitem.md) | This search method returns the TreeViewItem found and returns null if not found. |

### Remarks

Set the searchFromThisItem parameter to 'rootItem' to search the entire tree.
