Populates tree nodes recursively
Populates tree nodes recursively
private ListPopulateNodes(List menus, int pid) { List output = new List (); var temp = menus.Where(x => x.ParentId == pid).OrderBy(x => x.Sira); if (temp.Count() > 0) { foreach (var orgItem in temp) { //Dictionary dictionary = new Dictionary (); //dictionary.Add("expanded", ""); var t = new TreeViewItemModel() { Text = orgItem.Ad, Id = orgItem.Id.ToString() }; t.Items = PopulateNodes(menus, orgItem.Id); output.Add(t); } } return output; }