protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) { //check if we're rendering the root node's children if (id == Constants.System.Root.ToInvariantString()) { var ctrl = new IngredientApiController(); var nodes = new TreeNodeCollection(); foreach (var ingredient in ctrl.GetAll()) { var node = CreateTreeNode(ingredient.Id.ToString(), "-1", queryStrings, ingredient.Name, "icon-cocktail", false); nodes.Add(node); } return(nodes); } //this tree doesn't suport rendering more than 1 level throw new NotSupportedException(); }
protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) { //check if we're rendering the root node's children if (id == Constants.System.Root.ToInvariantString()) { var ctrl = new IngredientApiController(); var nodes = new TreeNodeCollection(); foreach (var ingredient in ctrl.GetAll()) { var node = CreateTreeNode(ingredient.Id.ToString(), "-1", queryStrings, ingredient.Name, "icon-cocktail", false); nodes.Add(node); } return nodes; } //this tree doesn't suport rendering more than 1 level throw new NotSupportedException(); }