This question is locked. New answers and comments are not allowed.
Hi guys,
In TreeView i am adding a single node at pageload. Loading their child on LoadOnDemand as follows. I gave ShowCheckBox(true). The check box is displaying only in the root node not on the nodes loaded on demand. Please let me know what am i doing wrong.
<%= Html.Telerik().TreeView() .Name("AjaxTreeView") .ShowCheckBox(true)
.Items(item => item.Add()
.Text("All Categories")
.LoadOnDemand(true))
.DataBinding(dataBinding => dataBinding .Ajax().Select("_AjaxLoading", "TreeView") )%>[AcceptVerbs(HttpVerbs.Post)] public ActionResult _AjaxLoading(TreeViewItemModel node) { NorthwindDataContext northwind = new NorthwindDataContext(); int? parentId = !string.IsNullOrEmpty(node.Value) ? (int?) Convert.ToInt32(node.Value) : null; IEnumerable nodes = from item in northwind.Employees where item.ReportsTo == parentId || (parentId == null && item.ReportsTo == null) select new TreeViewItemModel { Text = item.FirstName + " " + item.LastName, Value = item.EmployeeID.ToString(), LoadOnDemand = item.Employees.Count > 0, Enabled = true }; return new JsonResult { Data = nodes }; }Regards,
Pradeep.