Multiple roots

2 posts, 0 answers
  1. Brian
    Brian avatar
    32 posts
    Member since:
    Jun 2015

    Posted 23 Jan Link to this post

    So lets say I have a set of entities

              ObjectModel1 - Id, Name, List<ObjectModel2> Children

              ObjectModel2 - Id, Name, Note, DateModified, ModifiedBy

    So now my dataset might return

              ObjectModel1 om1a

                        ObjectModel2 om2a

                        ObjectModel2 om2b

              ObjectModel1 om1b
                        ObjectModel2 om2c
                        ObjectModel2 om2d

    This would come down as a List<ObjectModel1> object with the ObjectModel1 objects in the list having the ObjectModel2 objects as children.

    I would like to display this so that each of the ObjectModel1 objects are displayed as separate trees with all of the data from each ObjectModel2 object being displayed when the ObjectModel1 trees are expanded.

    So, first of all, is this possible with the Kendo treeview, and if not, what would we use?  Second, even if it is possible, is there a better UI component to do the above?   

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1773 posts

    Posted 25 Jan Link to this post

    Hello Brian,

    See the following demo, which shows a TreeView bound to data in a scenario similar to the one you describe (different models are used for root and child nodes). You can review the view and the controller logic in the demo's ASP.NET MVC source section.

    You can also check the demos of the TreeList, which combines the capabilities of the TreeView in displaying hierarchical data and some of the capabilities of the Grid (columns, editing, filtering, paging, etc.).

    Regards,
    Ivan Danchev
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top