I made an update of the UI for ASP.NET MVC. Now, in the tree view only the root is shown and no longer any child.
The view is as follows:
@(Html.Kendo().TreeView()
.Name("treeviewInner")
.BindTo((IEnumerable<TreeViewItemModel>)ViewBag.TreeViewContent)
)
Here is the code in the controller:
private List<TreeViewItemModel> GetTreeViewData()
{
var items = new List<TreeViewItemModel>()
{
new TreeViewItemModel()
{
Text = "0",
Items = new List<TreeViewItemModel>()
{
new TreeViewItemModel()
{
Text = "1"
}
}
}
};
return items;
}
public ActionResult TreeViewContent(int wbsHeaderId)
{
ViewBag.TreeViewContent = GetTreeViewData();
return PartialView();
}