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

How to skip one level in hierachy of the data bound to TreeView?

3 Answers 69 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Arpit
Top achievements
Rank 1
Arpit asked on 23 Feb 2011, 09:49 AM
Hi,

I have an entity whose structure is like this:

List of Universities
-->List of Colleges:
    -->List of Students:
        -->List of Assignments

I have list of universities with me which I want to bind to the tree and my requirement is to skip the node -"Student" in the tree so that it appears like-

University
-->College
---->Assignment

Is it possible using DataTemplate/HierarchicalDataTemplate of treeview?

3 Answers, 1 is accepted

Sort by
0
Arpit
Top achievements
Rank 1
answered on 23 Feb 2011, 01:32 PM
Can anyone please address it?
0
Tina Stancheva
Telerik team
answered on 28 Feb 2011, 03:28 PM
Hi Arpit,

In order to implement your scenario you can use a ValueConverter and change the ItemsSource of the HierarchicalDataTemplate that will control the display of the Colleges collection. That will allow you to create a collection of all Assignments of all Students in the College.

Please have a look at the attached sample and let me know if it works for you.

Greetings,
Tina Stancheva
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Arpit
Top achievements
Rank 1
answered on 28 Feb 2011, 06:01 PM
Thanks! I will look into it and will get back to you
Tags
TreeView
Asked by
Arpit
Top achievements
Rank 1
Answers by
Arpit
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or