RadTreeList CheckBoxes Select/Deselect

3 posts, 1 answers
  1. Abhishek
    Abhishek avatar
    45 posts
    Member since:
    Jul 2012

    Posted 11 Jan 2012 Link to this post

    Hello All,
         I have RadTreeList with Checkboxes, i wanted handle AllowRecursiveSelection functionality at the client side. But one condition there Please find Image for that "radtreelistcheckissue.png".


    Thanks In advance
    Abhishek K
  2. Answer
    Kaushal
    Kaushal avatar
    47 posts
    Member since:
    Sep 2010

    Posted 11 Jan 2012 Link to this post

    Hi,

    Try this:

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function OnClientNodeClicked(sender, args) {
                var currNode = args.get_item();
                var childNodes = currNode.get_childItems();
                var nodeCount = currNode.get_childItems().length;
                if (nodeCount > 0) {
                    var isChecked = currNode.get_selected();
                    UpdateAllChildren(currNode, childNodes, nodeCount, isChecked);
                }
            }
     
            function UpdateAllChildren(currNode, nodes, nodecount, checked) {
                var i;
                for (i = 0; i < nodecount; i++) {
                    if (checked) {
                        nodes[i].set_selected(true);
                    }
                    else {
                        nodes[i].set_selected(false);
                    }
                }
            }
        </script>
    </telerik:RadCodeBlock>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Abhishek
    Abhishek avatar
    45 posts
    Member since:
    Jul 2012

    Posted 11 Jan 2012 Link to this post

    Hi Kaushal,

    Thanks it works...!
Back to Top