Rudebox.co.nr How To Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Rudebox.co.nr How To Forums

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

 

 How to check all child nodes when parent node is checked

Go down 
AuthorMessage
Admin
Admin
Admin


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

How to check all child nodes when parent node is checked Empty
PostSubject: How to check all child nodes when parent node is checked   How to check all child nodes when parent node is checked Icon_minitimeWed 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
https://rudebox.editboard.com
 
How to check all child nodes when parent node is checked
Back to top 
Page 1 of 1

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: