Rudebox.co.nr How To Forums

Rudebox How To Forums - Ask Anything, View How To's
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in

Share | 
 

 How to check all child nodes when parent node is checked

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin
avatar

Number of posts : 216
Registration date : 2007-01-01

PostSubject: How to check all child nodes when parent node is checked   Wed Mar 28, 2007 10:46 pm

Give a cool idea to any programmer

Try this:

Add the following javascript functions to your ASPX page (or ASCX or MasterPage):

Code:
 function UpdateAllChildren(nodes, checked) 
            { 
                var i; 
                for (i=0; i<nodes.length; i++) 
                { 
                    checked ? nodes[i].Check() : nodes[i].UnCheck(); 
                    if (nodes[i].Nodes.length > 0) 
                    { 
                        UpdateAllChildren(nodes[i].Nodes, checked);     
                    } 
                } 
            } 
 
            function CheckChildNodes(node) 
            { 
                UpdateAllChildren(node.Nodes, node.Checked); 
            } 
 

Then use the "AfterClientCheck" handler in your control definition:

Code:
<radt:radtreeview 
id="RadTree1" 
runat="server" 
AfterClientCheck="CheckChildNodes"
... 
 />

Enjoy!
Back to top Go down
View user profile http://rudebox.editboard.com
 
How to check all child nodes when parent node is checked
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Guild Chest! (Also the Price Check Thread!)
» The Cabana Art Shop [Commission holders need to check this!]
» How to Check Basic Electronic Components
» Mining and other information:
» Hot Toys in Hong Kong...Price check Please!

Permissions in this forum:You cannot reply to topics in this forum
Rudebox.co.nr How To Forums :: How To - Myspace / Website /Blog Utilities :: ASP .net-
Jump to: