CheckBoxes="true" i开发者_开发知识库s set by default in a Telerik RadTreeView. But based on certain condition like if the resource id is 0 then the visibility of the check box must be set to false and the expand icon of the node must be hidden.
This can probably be done by:
- iterating through the treeview nodes (when build), for example inside the NodeCreated event handler
- locating the checkbox inside when node via the Controls collection
- setting its visible property accordingly
you can use the Following:
public void DisabledCheckBox()
{
foreach (RadTreeNode n in RadTreeView.GetAllNode())
{
if( condition)
{
n.Checkable=false;
}
}
}
regards
精彩评论