Hi,
I am currently wanting to implement the RadTreeView "Expand All" functionality.
I used "ServerSideCallBack" mode to expand nodes and used a menuitem to call the event(Expand All).
But when I click "ExpandAll" button to expand a selected node which its child child nodes count is more than 5, the first time it will get correct result.
At the second time to click "ExpandAll" button to expand this node, its child child nodes will appear in a confuse way. Only the top 5 child child nodes are correct, the others are wrong. Although we do nothing but only toggle the selected node in server side codes.
Below codes maybe helpful to understand it. Please tell me how to resolve it.
[Function:ExpandNode]
.....
foreach (RadTreeNode radTreeNode in treeNodes)
{
radTreeNode.NodeTemplate = new MyTemplate(radTreeNode);
currentNode.Nodes.Add(radTreeNode);
radTreeNode.DataBind();
}
[Function:Expand All]
if (!radTreeNode.Expanded)
{
if (radTreeNode.ExpandMode == TreeNodeExpandMode.ServerSideCallBack)
{
ExpandNode(radTreeNode);
}
else if(radTreeNode.Nodes.Count>0)
{
radTreeNode.Toggle();
}
}
foreach (RadTreeNode node in radTreeNode.Nodes)
{
ExpandAllNode(node);
}
I am currently wanting to implement the RadTreeView "Expand All" functionality.
I used "ServerSideCallBack" mode to expand nodes and used a menuitem to call the event(Expand All).
But when I click "ExpandAll" button to expand a selected node which its child child nodes count is more than 5, the first time it will get correct result.
At the second time to click "ExpandAll" button to expand this node, its child child nodes will appear in a confuse way. Only the top 5 child child nodes are correct, the others are wrong. Although we do nothing but only toggle the selected node in server side codes.
Below codes maybe helpful to understand it. Please tell me how to resolve it.
[Function:ExpandNode]
.....
foreach (RadTreeNode radTreeNode in treeNodes)
{
radTreeNode.NodeTemplate = new MyTemplate(radTreeNode);
currentNode.Nodes.Add(radTreeNode);
radTreeNode.DataBind();
}
[Function:Expand All]
if (!radTreeNode.Expanded)
{
if (radTreeNode.ExpandMode == TreeNodeExpandMode.ServerSideCallBack)
{
ExpandNode(radTreeNode);
}
else if(radTreeNode.Nodes.Count>0)
{
radTreeNode.Toggle();
}
}
foreach (RadTreeNode node in radTreeNode.Nodes)
{
ExpandAllNode(node);
}