This question is locked. New answers and comments are not allowed.
Hi Telerik Support and other members,
I am trying to display the treeview with a list of nodes showing the checkbox (.ShowCheckBox(true)). Currently the checkbox of each node is binded to a property of the tree node whichs drives whether the checkbox is checked or not. It works fine.
But now I am trying to disable the checkbox if the user does not have privilege to check/uncheck the checkboxes. I found that I am not able to do it at the binding level as the .Disabled property would only disable the node display name but not the checkbox.
Is there any other way to do it?
Thanks.
I am trying to display the treeview with a list of nodes showing the checkbox (.ShowCheckBox(true)). Currently the checkbox of each node is binded to a property of the tree node whichs drives whether the checkbox is checked or not. It works fine.
But now I am trying to disable the checkbox if the user does not have privilege to check/uncheck the checkboxes. I found that I am not able to do it at the binding level as the .Disabled property would only disable the node display name but not the checkbox.
Is there any other way to do it?
Thanks.
<% Html.Telerik().TreeView()
.Name(
"TreeView")
.ShowCheckBox(
true)
.ExpandAll(
true)
.BindTo(Model, mappings =>
{
mappings.For<
Code>(
binding => binding.ItemDataBound((item, code) => { item.Checked = code.PhaseId.HasValue; item.Text = code.CodeName +
" (" + code.CodeNumber + ")"; item.Value = code.CodeId.ToString(); })
.Children(code => code.ChildCodes));
mappings.For<
Code>(binding => binding.ItemDataBound((item, code) => { item.Text = code.CodeName; }));
})
.Render(); %>