public void AddChild(TreeNode node) { this.ChildNodes.Add(node); node.Tree = this.Tree; node.Parent = this; }
public static TreeNode GetNode(Employee item, IEnumerable<Employee> items) { TreeNode node = new TreeNode() { ThumbImageUrl = "/public/userfiles/employees/1.jpg", Title = item.FullName, Caption = item.JobTitleName, Action = "Card", Controller = "Employees", Id = item.Id }; IEnumerable<Employee> employees = items .Where(x => x.Manager != null && x.Manager.Id == item.Id).ToArray(); foreach (Employee employee in employees) { node.AddChild(GetNode(employee, items)); } return node; }
public void AddNode(TreeNode node) { this.Nodes.Add(node); node.Tree = this; }