Edit this page

Change the Default Height of a TreeViewItem

This tutorial will show you how to change the default height of a treeview.

Here is a simple treeview declaration:

    <telerik:RadTreeViewItem Header="Sport Categories">
        <telerik:RadTreeViewItem Header="Football">
            <telerik:RadTreeViewItem Header="Futsal"/>
            <telerik:RadTreeViewItem Header="Soccer"/>

In order to change the default height of the treeview item, you need to perform the following steps:

  1. Add an appropriate style in the resources:

        <Style TargetType="telerik:RadTreeViewItem" x:Key="TreeViewItemStyle">
            <Setter Property="MinHeight" Value="50"></Setter>
  2. Set the ItemContainerStyle of the RadTreeView and the RadTreeViewItem.

        <telerik:RadTreeView ItemContainerStyle="{StaticResource TreeViewItemStyle}">
            <telerik:RadTreeViewItem Header="Sport Categories" ItemContainerStyle="{StaticResource TreeViewItemStyle}">
                <telerik:RadTreeViewItem Header="Football" ItemContainerStyle="{StaticResource TreeViewItemStyle}">
                    <telerik:RadTreeViewItem Header="Futsal" ItemContainerStyle="{StaticResource TreeViewItemStyle}"/>
                    <telerik:RadTreeViewItem Header="Soccer" ItemContainerStyle="{StaticResource TreeViewItemStyle}"/>

    And here is the result:

See Also

Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article