CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 10/30/2006 8:27:11 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 21 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
BitShift
Asp.Net User
how to determine number of child and leafe nodes ?10/30/2006 8:27:11 PM

0/0

If I have a treeview and want to know how many child nodes and how many leaf nodes there are, how do I do it ?  If I have a root node and look at the count on its childnodes property, it just gives me how many child nodes, not the leafs under them. 

 help ?

Iori_Jay
Asp.Net User
Re: how to determine number of child and leafe nodes ?10/31/2006 9:05:39 AM

0/0

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
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Parallel and Distributed Processing and Applications: Second International Symposium, ISPA 2004, Hong Kong, China, December 13-15, 2004 ; Proceedings Authors: Jiannong Cao, Laurence Tianruo Yang, Minyi Guo, Francis Lau, Pages: 1058, Published: 2004
Advances in Database Technologies: ER'98 Workshops on Data Warehousing and Data Mining, Mobile Data Access, and Collaborative Work Support and Spatio-Temporal Data Management, Singapore, November 19-20, 1998 : Proceedings Authors: Y. Kambayashi, Pages: 592, Published: 1999
Proceedings of the Twenty-ninth International Conference on Very Large Databases, Berlin, Germany, 9-12 September, 2003: 9-12- September 2003 Berlin, Germany Authors: Johann Christoph Freytag, Pages: 1151, Published: 2003
Multimedia Data Mining and Knowledge Discovery Authors: Valery A Petrushin, Latifur Khan, SpringerLink (Online service, Pages: 0, Published: 2007
FUZZ-IEEE '99: 1999 IEEE International Fuzzy Systems Conference Proceedings : August 22-25, 1999, Seoul, Korea Authors: IEEE Neural Networks Council, IEEE Neural Networks Council, Institute of Electrical and Electronics Engineers, Korea Fuzzy Logic and Intelligent Systems Society, Pages: 1806, Published: 1999
Principles of Database Query Processing for Advanced Applications: Multimedia, Object-oriented and Distributed/Heterogeneous Databases Authors: Clement T. Yu, Weiyi Meng, Pages: 485, Published: 1998
Advances in Databases and Information Systems: 8th East European Conference, ADBIS 2004, Budapest, Hungary, September 22-25, 2004 : Proceedings Authors: Andras Benczúr, János Demetrovics, Georg Gottlob, Pages: 422, Published: 2004
3D Game Engine Design: A Practical Approach to Real-time Computer Graphics Authors: David H. Eberly, Pages: 561, Published: 2001

Web:
how to determine number of child and leafe nodes ? - ASP.NET Forums how to determine number of child and leafe nodes ? Last post 10-31-2006 5:05 AM by Iori_Jay. 1 replies. Sort Posts: ...
Displaying the number of children in each branch of a Flex Tree ... The following example shows how you can display the number of children in each .... How would you know if a node is an empty branch or just a leaf node? ...
Leaf node - Wikipedia, the free encyclopedia In computer science, a leaf node or external node is a node of a tree data structure that has zero child nodes. Often, leaf nodes are the nodes farthest ...
Children (Nodes API) Get the number of nodes in the list. protected boolean, isInitialized() ... Should be used to represent the children of leaf nodes. ...
root parent child leaf node edge has no right child. Therefore, node number. is a leaf if ...... Determine the signature (type and number of pa-. rameters, return type) for each method. ...
R*-Tree - The VRR Programmer's Manual In standard (A,B)-Tree, after the node is inserted, overfull nodes (i.e. the number of children exceeds B) on the trace from the newly inserted leaf to the ...
Non-leaf node penalty score assignment system and method for ... determining whether there is more than one identified child leaf node; ..... the penalty scores for leaf nodes 26 and 27 are compared to determine the more ...
PMML Documentation RIGHT-CHILD NUMBER #REQUIRED. CUT-VALUE CDATA #REQUIRED >. This denotes a non- leaf node in the tree. Its attributes are the node number, the attribute name ...
treeloader doesn't allow leaf node that can containChildren ... the second node should be a leaf and not have the plus expander, and also support the addition of children to it. an example would be an ...
Analysis of Algorithms: Lecture 5 An internal node is a node that isn't a leaf. The degree of a node is the number of children that node has; it is either 0, 1 or 2. ...




Search This Site:










menu and video display

asp:menu styling questions

is it possible synchronize a treeview control after treeview data has been updated... without refreshing the page?

unnecessery footer movement in master page

change what contentplaceholder masterpage points to from default.aspx to something else

menu control not applying horizontalpadding

sitemapdatasource and adding menu items dynamically ?

master pages ?

send the required query variables in “post” in a submit page + pages using master pages

sitemapnode contructor parameters

master page control question

sitemapnode - anonymous users only?

hide child item of a menu.

master/ content page: how to invoking button click event?

treeview: parent nodes without url

problem with "go back" link

treeview selectednodestyle background problem.

content place holder help plz?

problems accessing property on root masterpage

is it possible to have more than one root menu item?

how to display treeview without its rootnode

populate treeview programatically

"microsoft jscript runtime error: object expected" when redirecting from content page

runtime determination imagebutton or button

how to change the hyperlink(maybe navigation menu) saved in masterpage the dynamic linked address?

menu image backgrounds

creating xml document for treeview and menu control

make nav treeview visible only on mouseover

only one server-side form on one page problem

dynamic content within master pages

  Privacy | Contact Us
All Times Are GMT