Get Content of RadTreeViewItem to Fill Full Size of Container

Environment

Product Version 2019.2.618
Product RadTreeView for WPF

Description

How to stretch RadTreeViewItem content horizontally in order to fill the full size of the container.

Solution

Set the HorizontalContentAlignment property of RadTreeViewItem to Stretch.

To apply this globally to all RadTreeViewItems in the treeview, use the ItemContainerStyle property.

<telerik:RadTreeView.ItemContainerStyle> 
    <Style TargetType="telerik:RadTreeViewItem"> 
        <Setter Property="HorizontalContentAlignment" Value="Stretch" /> 
    </Style> 
</telerik:RadTreeView.ItemContainerStyle> 
To apply it per item set the property directly on the RadTreeViewItem.

<telerik:RadTreeViewItem HorizontalContentAlignment="Stretch" /> 
In this article
Not finding the help you need? Improve this article