Self Referene Hierarchy In RadTreeListView

6 posts, 0 answers
  1. Kiran
    Kiran avatar
    36 posts
    Member since:
    Jul 2010

    Posted 15 Dec 2010 Link to this post

    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
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Dec 2010 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Kiran
    Kiran avatar
    36 posts
    Member since:
    Jul 2010

    Posted 15 Dec 2010 Link to this post

    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

  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 15 Dec 2010 Link to this post

    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
  6. Kiran
    Kiran avatar
    36 posts
    Member since:
    Jul 2010

    Posted 15 Dec 2010 Link to this post

    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
  7. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 21 Dec 2010 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready