This is a migrated thread and some comments may be shown as answers.

Expandable node doesnt show text

1 Answer 73 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
ss asked on 21 Jul 2010, 11:55 AM

I have problem with TreeView. I have following code:

<UserControl xmlns:telerik=""  x:Class="AdministrationClient.Pages.SettingsManagerPage"
    d:DesignHeight="300" d:DesignWidth="400">
        <core:HierarchicalDataTemplate x:Key="SettingsTreeNodeTemplate" ItemsSource="{Binding Children}">
                    <TextBlock Text="{Binding Text}" TextWrapping="Wrap" Width="400"/>
    <Grid x:Name="LayoutRoot" Background="White">
            <RowDefinition Height="22" />
            <RowDefinition />
            <ColumnDefinition Width="500" />
            <ColumnDefinition />
        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.ColumnSpan="2" FlowDirection="RightToLeft">
            <telerik:RadButton Name="btnNewSettingsItem" Width="55" Height="22" Content="New" />
            <TextBox Text="{Binding Path=Name}"></TextBox>
            ItemsSource="{Binding SettingsTree}" 
            ItemTemplate="{StaticResource SettingsTreeNodeTemplate}">

I dont know why but result of this code is TreeView which is shown in the following picture:

Can you please tell my why expandable node doesnt show text?

My Next question is how to show more than two levels? Just now, TreeView is able to show only 2 levels but I dont know number of levels. Is it possible?

Thank you very much.




1 Answer, 1 is accepted

Sort by
Telerik team
answered on 22 Jul 2010, 05:32 PM

You need to include the <TextBlock Text="{Binding Text}" /> for the outer HierarchicalDataTemplate. This way you are going to define the template for the first tree level. By setting the ItemTemplate property you are defining template for the children (second level).

I recommend you to take a look of the examples available at
especially the .

Regarding your second question you can see the following resource .

Best wishes,
Hristo Milyakov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question