开发者

set the checkbox visibility to false and remove the expand icon for a node based on certain condition in Telerik RadTreeView

开发者 https://www.devze.com 2023-03-12 22:24 出处:网络
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 a

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

0

精彩评论

暂无评论...
验证码 换一张
取 消