Hi,
I have a radtreeview with load on-demand functionality and works fine.
What I would like to do is to hide checkbox for nodes which have child nodes count > 0. For root data it works, but not for child nodes.
Here is my code:
How can I achieve this?
Thanks in advance.
I have a radtreeview with load on-demand functionality and works fine.
What I would like to do is to hide checkbox for nodes which have child nodes count > 0. For root data it works, but not for child nodes.
Here is my code:
private
static
void
LoadRootNodes(RadTreeView treeView, TreeNodeExpandMode expandMode)
{
.
.
.
foreach
(var row
in
sdps)
{
RadTreeNode node =
new
RadTreeNode
{
Text = row.FullText,
Value = row.id.ToString(),
ExpandMode = expandMode
};
node.Attributes.Add(
"IdAsText"
, row.IdAsText);
if
(row.ChildrenCount== 0)
{
node.ExpandMode = TreeNodeExpandMode.ClientSide;
}
else
{
//This works because RadTreeNode has a Checkable propery
node.Checkable =
false
;
}
treeView.Nodes.Add(node);
}
}
[WebMethod]
public
static
RadTreeNodeData[] LoadSdpTreeView(RadTreeNodeData node)
{
.
.
.
List<RadTreeNodeData> result =
new
List<RadTreeNodeData>();
foreach
(var row
in
childNodes)
{
RadTreeNodeData childNode =
new
RadTreeNodeData { Text = row.FullText, Value = row.id.ToString() };
childNode.Attributes.Add(
"IdAsText"
, row.IdAsText);
if
(row.ChildrenCount > 0)
{
childNode.ExpandMode = TreeNodeExpandMode.WebService;
// This doesnt work because there is no Checkable propery for RadTreeNodeData
// childNode.Checkable = false;
}
result.Add(childNode);
}
return
result.ToArray();
}
How can I achieve this?
Thanks in advance.