# GetTreeItemsCount()

> Get the number of items in the whole tree.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.UIElements](/engine/6000.3/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

```csharp
public virtual int GetTreeItemsCount()
```

### Returns

| Type                                                       | Description                      |
| ---------------------------------------------------------- | -------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of items in the tree. |

### Remarks

This is different from [CollectionViewController.GetItemsCount()](/engine/6000.3/script-reference/unityengine/uielements/collectionviewcontroller/getitemscount.md), which will return the number of items in the source.
