Only root level displays on RadTreeView + WrapPanel

2 posts, 1 answers
  1. Johnson
    Johnson avatar
    1 posts
    Member since:
    Sep 2014

    Posted 04 Sep 2014 Link to this post

    I have a every simple RadTreeview with 2 level deep children and a wrap panel to mimic explorer list view style.
    The root level is showing fine, but beyond root level is NOT showing the children nodes.  It is, however, only showing the place holder (radtreeview.png).

    It works fine if I use System.Windows.Controls.TreeView(TreeView.png), but I need to use RadTreeview.

    Any help would be much appreciated.

        <Grid Margin="10" >
               <telerik:RadTreeView x:Name="trvMenu" 

                    <ItemsPanelTemplate >
                        <telerik:RadWrapPanel Orientation="Vertical" />
                    <HierarchicalDataTemplate DataType="{x:Type MenuItem}" ItemsSource="{Binding Items}" >
                        <TextBlock Text="{Binding Title}" />

  2. Answer
    Petar Mladenov
    Petar Mladenov avatar
    3140 posts

    Posted 08 Sep 2014 Link to this post

    Hi Johnson,

    RadTreeView is an ItemsControl and every RadTreeViewItem is an ItemsControl too. This means that with your configuration you are setting WrapPanel only for the root level items of the tree. To set it for every level, you can use the ItemContainerStyle property of the RadTreeView like so:

    <telerik:RadTreeView  x:Name="treeA" HorizontalAlignment="Right" Width="300"
                                   IsEditable="True" IsDragDropEnabled="True"
                                   ItemTemplate="{StaticResource template}">
                     <ItemsPanelTemplate >
                         <telerik:RadWrapPanel Orientation="Vertical" />
                     <Style TargetType="telerik:RadTreeViewItem">
                         <Setter Property="ItemsPanel">
                                     <telerik:RadWrapPanel Orientation="Vertical" />

    We hope this will help you move forward.

    Petar Mladenov
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
Back to Top