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

4 posts, 0 answers
  1. Arpit
    Arpit avatar
    49 posts
    Member since:
    Nov 2010

    Posted 23 Feb 2011 Link to this post

    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?
  2. Arpit
    Arpit avatar
    49 posts
    Member since:
    Nov 2010

    Posted 23 Feb 2011 Link to this post

    Can anyone please address it?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 28 Feb 2011 Link to this post

    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!
  5. Arpit
    Arpit avatar
    49 posts
    Member since:
    Nov 2010

    Posted 28 Feb 2011 Link to this post

    Thanks! I will look into it and will get back to you
Back to Top