This is a migrated thread and some comments may be shown as answers.

Models for demos

3 Answers 104 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jesse
Top achievements
Rank 1
Jesse asked on 23 Sep 2015, 04:11 PM

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

http://demos.telerik.com/aspnet-mvc/treeview/remote-data-binding

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?

 

 

3 Answers, 1 is accepted

Sort by
0
Eduardo Serra
Telerik team
answered on 23 Sep 2015, 07:59 PM
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.        }
09.     
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; }
28.     
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.

Regards,
Eduardo Serra
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jay
Top achievements
Rank 1
Iron
Iron
answered on 05 Mar 2019, 01:59 AM

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.

 

0
Dimitar
Telerik team
answered on 06 Mar 2019, 11:19 AM
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.

Regards,
Dimitar
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.
Tags
TreeView
Asked by
Jesse
Top achievements
Rank 1
Answers by
Eduardo Serra
Telerik team
Jay
Top achievements
Rank 1
Iron
Iron
Dimitar
Telerik team
Share this question
or