TreeView Employees1 property

2 posts, 0 answers
  1. Kenp
    Kenp avatar
    2 posts
    Member since:
    Feb 2015

    Posted 06 Feb 2015 Link to this post


    I'm new to  kendo and i was trying to display a treeView using the ASP MVC approach so i followed the exemple you provided :

    var employees = from e in db.Employees
                                where (id.HasValue ? e.ReportsTo == id : e.ReportsTo == null)
                                select new
                                    id =,
                                    Name = e.FirstName + " " + e.LastName,
                                    hasChildren = e.Employees1.Any()

    But what is the code inside the Employees1 property ? It should be a recursive method somehere ? Please provide the content of the model or give me more details to how make it work

    Thanks for the help
  2. Daniel
    Daniel avatar
    2231 posts

    Posted 11 Feb 2015 Link to this post


    I posted my reply in the other thread that you have opened with the same question. For convenience, I am pasting it below:

    Employees1 is a navigational property created by EF which can be used to get the related employees. No recursive function is needed in this scenario. The particular demo loads the children on demand and makes a separate request for each node children so the result from the server should be just the children of the item with id equal to the id value passed with the request. You can check the model and all related code in the sample application included with the wrappers.


    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.

Back to Top