Feb 25, 2014, 4:56 PM
[CLOSED] TreePanel - SubmittedNode - Get Children SubmittedNodes
Hi,
I'm working with a treepanel.
I need to get (Server side) a list containing all the tree nodes which are children of the selected node. (the tree is in single select mode).
So, I did that with a recursive function, but the field Children of a SubmittedNode is always empty, so this recursion doesn't work.
Have a good day!
I'm working with a treepanel.
I need to get (Server side) a list containing all the tree nodes which are children of the selected node. (the tree is in single select mode).
So, I did that with a recursive function, but the field Children of a SubmittedNode is always empty, so this recursion doesn't work.
private List<int> GetComponentiFigli() {
List<int> res = new List<int>();
List<SubmittedNode> lstSubmitted = new List<SubmittedNode>();
lstSubmitted = GetChildSubmittedNode(TreeFunctional.SelectedNodes[0], lstSubmitted);
foreach (SubmittedNode s in lstSubmitted)
res.Add(Convert.ToInt32(s.Attributes["ID_INV_REGISTRY"]));
return res;
}
private List<SubmittedNode> GetChildSubmittedNode(SubmittedNode node, List<SubmittedNode> list)
{
foreach (SubmittedNode i in node.Children)
list.AddRange(GetChildSubmittedNode(i, list));
return list;
}
Thanks for your time.Have a good day!
Last edited by Daniil; Feb 27, 2014 at 1:46 PM.
Reason: [CLOSED]