This question is locked. New answers and comments are not allowed.
Hi,
How can I remove checkbox from all parent nodes in treeview. I am binding it in following way, but this removes checkbox only from first level of parents.
How can I remove checkbox from all parent nodes in treeview. I am binding it in following way, but this removes checkbox only from first level of parents.
<%
= Html.Telerik().TreeView()
.Name("TreeView1")
.ShowLines(true)
.ShowCheckBox(true)
.ClientEvents(events => events
.OnChecked("onChecked")
.OnLoad("onLoad")
)
.BindTo(SiteMap.Provider.RootNode.ChildNodes, mappings =>
{
mappings.For<SiteMapNode>(binding => binding
.ItemDataBound((item, navitem) =>
{
item.Text = navitem.Title;
item.Value = navitem.Description;
if (item.Parent == null)
{
item.Checkable = false;
}
if(ViewData["Fn_Id"] != null && item.Value.Contains(ViewData["Fn_Id"].ToString()))
{
item.Checked = true;
item = item.Parent;
while(item!=null)
{
item.Expanded = true;
item = item.Parent;
}
}
})
.Children(navitem => navitem.ChildNodes)
.Children(childitem => childitem.ChildNodes));
})
%>