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

Self Referene Hierarchy In RadTreeListView

5 Answers 179 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Kiran
Top achievements
Rank 1
Kiran asked on 15 Dec 2010, 09:14 AM
Hi

I have a hierarchy structure like this. Can i use RadTreeList to display the structure. I understand we can SelfReferenceHierarchy feature of RadGridView but is this supported in RadTreeListView

Task 1
    Task 1.1
        Task 1.1.1
Task 2
    Task 2.1

The problem I am facing with RadGridView is that columns are not coming up aligned so i wanted to see if RadTreeListView solves my problem

Regards
Kiran

5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Dec 2010, 09:18 AM
Hello,

 Indeed you can use our RadTreeListView to display such structure - more info can be found on our demos. The demo link is for our Silverlight demos however the WPF version is exactly the same. 

All the best,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Kiran
Top achievements
Rank 1
answered on 15 Dec 2010, 11:02 AM
Hi

I am trying to use RadTreeListView like this but only first row shows up but nothing happens when we click on down arrow.

<telerik:RadTreeListView  x:Name="FrameworkPermissions"
                          IsReadOnly="False"
                          AutoGenerateColumns="False"
                          CanUserFreezeColumns="False" IsFilteringAllowed="False" GridLinesVisibility="Both"
                          Loaded="FrameworkPermissions_Loaded" ShowGroupPanel="False"
                          AllowDrop="False" ItemsSource="{Binding Path=RolePermissionsList, Mode=TwoWay}"                           RowLoaded="FrameworkPermissions_RowLoaded">
  
<telerik:RadTreeListView.FilterDescriptors>
       <telerik:FilterDescriptor Member="ParentTaskID" Operator="IsEqualTo"  Value="0"/>
</telerik:RadTreeListView.FilterDescriptors>
  
<telerik:RadTreeListView.ChildTableDefinitions>
         <telerik:TreeListViewTableDefinition>
                  <telerik:TreeListViewTableDefinition.Relation>
                  <telerik:TableRelation IsSelfReference="True">
                  <telerik:TableRelation.FieldNames>
                  <telerik:FieldDescriptorNamePair  
                           ParentFieldDescriptorName="TaskID" 
                           ChildFieldDescriptorName="ParentTaskID" />
                  </telerik:TableRelation.FieldNames>
                  </telerik:TableRelation>
                  </telerik:TreeListViewTableDefinition.Relation>
         </telerik:TreeListViewTableDefinition>
</telerik:RadTreeListView.ChildTableDefinitions>
</telerik:RadTreeListView>

Is there anything else I need to do.

Regards
Kiran

0
Vlad
Telerik team
answered on 15 Dec 2010, 11:28 AM
Hi,

 Can you comment temporary FilterDescriptors declaration to see what will be the result?

Kind regards,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Kiran
Top achievements
Rank 1
answered on 15 Dec 2010, 12:42 PM
Hi

I tried commenting filter descriptors though it shows all records i dont get the tree effect. When i was trying the same thing with the grid earlier i had to use DataLoading event to construct child events.

public class Task
{
    public int TaskId { get; set; }
    public int ParentTaskId { get; set; }
    public string TaskName { get; set; }
    public bool Read {get; set;}
    List<bool> rolePermission = new List<bool>();
    public IList<bool> RolePermission
    {
        get { return this.rolePermission; }
    }
}

This is the data structure I am using to populate data for the control.

Regards
Kiran
0
Pavel Pavlov
Telerik team
answered on 21 Dec 2010, 12:27 PM
Hi Kiran,

I have made some checks and here are my findings : 
In order to be able to display your Task objects in RadTreeListView, you will need to add one more property to the TaskObject - e.g. SubTasks to hold a collection of the subnodes.

Then use XAML like :
<telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:TreeListViewTableDefinition ItemsSource="{Binding SubTasks}" />
   </telerik:RadTreeListView.ChildTableDefinitions>

Regards,
Pavel Pavlov
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
TreeListView
Asked by
Kiran
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Kiran
Top achievements
Rank 1
Pavel Pavlov
Telerik team
Share this question
or