Models for demos

4 posts, 0 answers
  1. Jesse
    Jesse avatar
    6 posts
    Member since:
    Jan 2008

    Posted 23 Sep 2015 Link to this post

    I am creating a treeview, loaded from remote hierarchical data, similar to

    I am trying to understand this line in the controller:

     hasChildren = e.Employees1.Any()

    I assume that the employee model has a property where it checks for children.  Where can I actually look at the model?  Can I download all the demos along with the data model?



  2. Eduardo Serra
    Eduardo Serra avatar
    119 posts

    Posted 23 Sep 2015 Link to this post

    Hi Jesse,

    This is the complete Employee model used in the MVC examples:

    01.public partial class Employee
    02.    {
    03.        public Employee()
    04.        {
    05.            this.Employees1 = new HashSet<Employee>();
    06.            this.Orders = new HashSet<Order>();
    07.            this.Territories = new HashSet<Territory>();
    08.        }
    10.        public int EmployeeID { get; set; }
    11.        public string LastName { get; set; }
    12.        public string FirstName { get; set; }
    13.        public string Title { get; set; }
    14.        public string TitleOfCourtesy { get; set; }
    15.        public Nullable<System.DateTime> BirthDate { get; set; }
    16.        public Nullable<System.DateTime> HireDate { get; set; }
    17.        public string Address { get; set; }
    18.        public string City { get; set; }
    19.        public string Region { get; set; }
    20.        public string PostalCode { get; set; }
    21.        public string Country { get; set; }
    22.        public string HomePhone { get; set; }
    23.        public string Extension { get; set; }
    24.        public byte[] Photo { get; set; }
    25.        public string Notes { get; set; }
    26.        public Nullable<int> ReportsTo { get; set; }
    27.        public string PhotoPath { get; set; }
    29.        public virtual ICollection<Employee> Employees1 { get; set; }
    30.        public virtual Employee Employee1 { get; set; }
    31.        public virtual ICollection<Order> Orders { get; set; }
    32.        public virtual ICollection<Territory> Territories { get; set; }
    33.    }

    As you can see, Employee1 is a HashSet of Employee objects that allows us to have a list without duplicates of all the employees that work under another. In the case of hasChildren = e.Employees1.Any() we are checking if there is at least one Employee in the HashSet.

    There are two ways to get the source code for all the MVC demos. The first one is to get them through the Telerik Control Panel: after you select to update or install UI for ASP.NET MVC and hit proceed, check the Local Demos box and finish the rest of the process. The second way is to go to Your Account page in Telerik's website and find ​UI for ASP.NET MVC under your products list, select Browse all product files and download the Manual Installation compressed file; it contains the Kendo.Mvc.Examples solution.

    I hope this helps.

    Eduardo Serra
  3. Jay
    Jay avatar
    6 posts
    Member since:
    Feb 2019

    Posted 04 Mar 2019 in reply to Eduardo Serra Link to this post

    No such link called "Browse all product files" exists. Or, if it does, it's hiding in plain sight. In any case, I can't find it.


  4. Dimitar
    Dimitar avatar
    700 posts

    Posted 06 Mar 2019 Link to this post

    Hello Jay,

    The Telerik UI for ASP.NET MVC ships a Sample Application that is a mirror of the ASP.NET MVC Demos site. You can find additional information on how to set it up from the following article:

    With this application, you will be able to run and examine all of the demos locally, modify them and test the different configuration options and get familiar with how each widget works.

    Progress Telerik
Back to Top