GridView or TreeListView and how?

4 posts, 0 answers
  1. Gábor
    Gábor avatar
    13 posts
    Member since:
    Sep 2012

    Posted 15 Apr 2014 Link to this post

    Hi!

    I have the following data structure: 
    A tree of objects of the same type. The number of children is not fixed nor the depth of the branches.
    I want to be able to sort one selected node's children by some property. By default in TreeListView the sorting effects the whole tree.
    So the result view should contain a header for every opened node to allow the user to sort every opened node's children by an arbitrary property.
    This view is similar to a GridView with hierarchical child grids in arbitrary depth.
      
    Which control should I use and how can I do this?

    (I didn't find any demo similar enough to my goal to start the work from it)

    Sorry for bad English,
    Thanks for the answers!
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1219 posts

    Posted 18 Apr 2014 Link to this post

    Hi,

    I would recommend RadGridView with custom RowDetails template. I am attaching a sample project that demonstrates such scenario.

    Regards,
    Ivan Ivanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Gábor
    Gábor avatar
    13 posts
    Member since:
    Sep 2012

    Posted 22 Apr 2014 in reply to Ivan Ivanov Link to this post

    I want arbitrary deep hierarchy of objects where all the objects are from the same type. 
    So your sample project doesn't provide a solution to my problem.
    Could You take one more look at it?
  4. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1219 posts

    Posted 25 Apr 2014 Link to this post

    Hello,

    It seems that both controls are not very suitable out of the box, but with certain modifications you can achieve the desired result. Basically, you can display arbitrary hierarchy level by setting RowDetailsTemplate on each of the nested RadGridViews. Overriding the default sorting behavior of RadTreeListView to sort only the root level items would be more complex task and it may interfere with other core features of RadTreeListView, so I would still recommend RadGridView. 

    Regards,
    Ivan Ivanov
    Telerik
     
    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