I am trying to set the checked state to true on the children of a tree node when the parent is checked. Following is the treeview and javascript function i tried. Can someone review to make sure the syntax is correct and provide input on whether it whould work?
| <telerik:RadTreeView ID="treeProducts" runat="server" CheckBoxes="true" |
| DataFieldID="ProductID" DataFieldParentID="ParentProductID" DataSourceID="odsProducts" |
| DataTextField="ProductName" DataValueField="ProductID" |
| OnClientNodeChecking="ProductChecking"> |
| </telerik:RadTreeView> |
| function ProductChecking(sender, eventArgs) |
| { |
| var node = eventArgs.get_node() |
| if(node.get_nodes().get_count() > 0) |
| { |
| for (var i=0; i<node.get_nodes().get_count();i++) |
| { |
| var childnode = node.get_nodes().getNode(i); |
| childnode.set_checked(true); |
| } |
| } |
| } |