Changing CheckChildNodes property in the client side

5 posts, 1 answers
  1. NLV
    NLV avatar
    87 posts
    Member since:
    Aug 2009

    Posted 12 Mar 2010 Link to this post

    Hello
    I want to change the CheckChildNodes property of the treeview in the client side in multiple situations when particular nodes are clicked. How can i do that?

    Regards
    NLV

  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Mar 2010 Link to this post

    Helo,

    I tried the following client code in order to set the CheckChildNodes property from client.

    JavaScript:

     
    function setProperty() {  
            var treeView = $find('<%=RadTreeView1.ClientID%>');  
            treeView._checkChildNodes = false// Set the value  
        } 

    Regards,

    Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 12 Mar 2010 Link to this post

    Hi NLV,

    Please take a look at this help topic. In the bottom of the page is presented some way to check all child nodes when checking their parent in Javascript:

    var expandedNodeChecked = null;
             
    function onClientNodePopulated(sender, eventArgs)
    {
    if (expandedNodeChecked != null)
    {
     var parentNode = eventArgs.get_node();
     var childNodes = parentNode.get_nodes();
     var childNodeCount = childNodes.get_count();
       
     for (var nodeIndex = 0; nodeIndex < childNodeCount; nodeIndex++)
     {
      var childNode = childNodes.getNode(nodeIndex);
        
      childNode.set_checked(expandedNodeChecked);
     }
    }
    }
    function onClientNodePopulating(sender, eventArgs)
    {
    expandedNodeChecked = eventArgs.get_node().get_checked();
    }


    Regards,
    Veronica Milcheva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. NLV
    NLV avatar
    87 posts
    Member since:
    Aug 2009

    Posted 12 Mar 2010 Link to this post

    Hi Veronica Milcheva

    Thanks for your reply. But i think looping is not gonna work if the childeNodeCount is very large.

    @shinu - Let me try out the solution you gave. I previously tried it as

    $find('<%=RadTreeView1.ClientID%>').CheckChildNodes = false 




    and it dint work!

    Regards
    NLV
  6. NLV
    NLV avatar
    87 posts
    Member since:
    Aug 2009

    Posted 15 Mar 2010 Link to this post

    Thanks Shinu. Your solution worked.

    Cheers!

    NLV
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017