Radtreeview parent checkboxes

2 posts, 0 answers
  1. Samir
    Samir avatar
    8 posts
    Member since:
    Jul 2009

    Posted 08 Jul 2009 Link to this post

    Hi -

     i have a radtreeview with checkboxes. I want to make sure that when the user checks all the child nodes manually, parent node should NOT get checked by itself, it should only have indeterminate state. Only if user manually checks the parent node, it should be checked. Thanks in advance.

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Jul 2009 Link to this post

    Hello,

    Try the following client side code and see whether it is working as expected.

    JavaScript:
     
    <script type="text/javascript">  
    var parentNode;  
    function OnClientNodeChecking(sender, args)  
    {  
         if(args.get_node().get_parent() != sender)  
         {  
            parentNode = args.get_node().get_parent();  
            setTimeout("parentNode.get_checkBoxElement().className = 'rtIndeterminate';",10);  
         }       
    }  
    </script> 
    Attach the OnclientNodeCkecking event to RadTreeView.

    Thanks,
    Princy.
Back to Top