You may need to write your own recursion function to do this, here is an example:
public static int GetTreeNodeCount(TreeNode root)
{
int i = root.ChildNodes.Count;
foreach (TreeNode tn in root.ChildNodes)
{
i += GetTreeNodeCount(tn);
}
return i;
}
protected void Button1_Click(object sender, EventArgs e)
{
TreeNode root = LinksTreeView.Nodes[0];
int cnt=GetTreeNodeCount(root);
Response.Write("There are " + cnt + " nodes(s)");
}
Welcome to my SQL/ASPNET forum for Chinese
http://51up.org/bbs/forumdisplay.php?fid=38