# Items Indent

The **RadTreeView** allows you to control the indent of its items. You can do that by changing the value of the **ItemsIndent** property. The default value of this property is 20.

**Example 1: Setting ItemsIndent Property**

```XAML
<telerik:RadTreeView ItemsIndent="0" ItemsSource="{Binding NodeColletion}" ItemTemplate="{StaticResource dataTemplate}"/>
```

By setting the **ItemsIndent** property to 0, we will vertically align all items in the RadTreeView. You can observe the outcome in **Figure 1**.

> caption Vertically align TreeView items

![Rad Tree View Features ItemsIndent 1](https://www.telerik.com/products/wpf/documentation/assets/6a9d21a0c1d5c8b903d3dd45add66d39/radtreeview_itemsindent_01.png)

## ExpanderButtonMinWidth

With the **2021 R1 SP1** version of Telerik UI for WPF, we have to introduce the **ExpanderButtonMinWidth** property of the RadTreeViewItem to control the width of the expander **ToggleButton**. This property has a different value depending on the theme.

In **Figure 1**, the roots, and their nodes are vertically aligned. In a case when the nodes do not have children, the expander button will not be visible. Nevertheless, the expander ToggleButton is not visible. It still will occupy space depending on the **ExpanderButtonMinWidth** property value. To completely remove the button, you can set the **ExpanderButtonMinWidth** property to 0 and Collapsed the button. **Example 2** demonstrate how you can do that through implicit style.

**Example 2: Collapsed Expander Button**

```XAML
<Style TargetType="telerik:RadTreeViewItem" BasedOn="{StaticResource RadTreeViewItemStyle}">
    <Setter Property="ExpanderButtonMinWidth" Value="0" />
    <Setter Property="ExpanderStyle">
        <Setter.Value>
            <Style TargetType="ToggleButton">
                <Setter Property="Visibility" Value="Collapsed" />
            </Style>
        </Setter.Value>
    </Setter>
</Style>
```

> caption Collapsed expander button

![Rad Tree View Features ItemsIndent 1](https://www.telerik.com/products/wpf/documentation/assets/852ec9344bac507e14555d91b8688ed7/radtreeview_itemsindent_02.png)

## TreeView Lines and Item Indent

The control allows you to show connected lines between the nodes and their root nodes. More information regarding this feature can be found in the [Lines Support](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/features/lines-support) topic.

To correctly adjust the nodes' lines, the **ItemsIndent** and **ExpanderButtonMinWidth** properties need to be set. The **ItemsIndent** property needs to be at least the half size of the expander Button. On the other hand, the ExpanderButtonMinWidth needs to be set to an odd value bigger than the expander button width.

> The expander path element has a different width in different themes.

> caption Default size of the elements in fluent theme

![Rad Tree View Features ItemsIndent 1](https://www.telerik.com/products/wpf/documentation/assets/d6b0a151979ad976c50baf5fa064741e/radtreeview_itemsindent_03.png)

In the above case, we will reduce the space by using the **ItemsIndent** and **ExpanderButtonMinWidth** properties. The **ExpanderButtonMinWidth** property can be set to an odd value bigger than the path's width. In our case, the minimum value will be 17.

**Example 3: Set Compact View**

```XAML
<Window.Resources>
    <HierarchicalDataTemplate x:Key="dataTemplate" ItemsSource="{Binding Children}" >
        <TextBlock Text="{Binding Header}" />
    </HierarchicalDataTemplate>
    <Style TargetType="telerik:RadTreeViewItem" BasedOn="{StaticResource RadTreeViewItemStyle}">
        <Setter Property="ExpanderButtonMinWidth" Value="17"/>
    </Style>
</Window.Resources>
<Grid>
    <telerik:RadTreeView Background="Bisque" Loaded="RadTreeView_Loaded" ItemsIndent="9"  IsLineEnabled="True" IsRootLinesEnabled="True"  ItemsSource="{Binding NodeColletion}" ItemTemplate="{StaticResource dataTemplate}"/>
</Grid>
```

> caption Compact TreeView lines

![Rad Tree View Features ItemsIndent 1](https://www.telerik.com/products/wpf/documentation/assets/0af4232ed42c1757dcdf6f77da83c768/radtreeview_itemsindent_04.png)

## See Also

* [Selection](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/features/feautres-treeviewitem-selection)
* [Drag and Drop](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/features/dragdrop/drag-and-drop)
* [UI Virtualization](https://www.telerik.com/products/wpf/documentation/controls/radtreeview/features/ui-virtualization)
