# TreeViewItem

> TreeViewItem constructor.

## Definition

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

## TreeViewItem()

TreeViewItem constructor.

> **Warning:**
>
> **Deprecated.** TreeViewItem is now deprecated. You can likely now use TreeViewItem\\\<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 TreeViewItem\\\<InstanceID\\> to get the proper typing.

```csharp
public TreeViewItem()
```

## TreeViewItem(int)

TreeViewItem constructor.

> **Warning:**
>
> **Deprecated.** TreeViewItem is now deprecated. You can likely now use TreeViewItem\\\<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 TreeViewItem\\\<InstanceID\\> to get the proper typing.

```csharp
public TreeViewItem(int id)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Unique ID to identify this TreeViewItem with among all TreeViewItems of the TreeView. See Also id.

## TreeViewItem(int, int)

TreeViewItem constructor.

> **Warning:**
>
> **Deprecated.** TreeViewItem is now deprecated. You can likely now use TreeViewItem\\\<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 TreeViewItem\\\<InstanceID\\> to get the proper typing.

```csharp
public TreeViewItem(int id, int depth)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Unique ID to identify this TreeViewItem with among all TreeViewItems of the TreeView. See Also id.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Depth of this TreeViewItem. See Also depth.

## TreeViewItem(int, int, string)

TreeViewItem constructor.

> **Warning:**
>
> **Deprecated.** TreeViewItem is now deprecated. You can likely now use TreeViewItem\\\<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 TreeViewItem\\\<InstanceID\\> to get the proper typing.

```csharp
public TreeViewItem(int id, int depth, string displayName)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Unique ID to identify this TreeViewItem with among all TreeViewItems of the TreeView. See Also id.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Depth of this TreeViewItem. See Also depth.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Rendered name of this TreeViewItem. See Also displayName.
