How to retrieve TreeView Selected Node from Javascript

2 posts, 0 answers
  1. Sri
    Sri avatar
    22 posts
    Member since:
    Jun 2009

    Posted 06 Jul 2009 Link to this post

    I have the following Javascript in the toolbar's button click to retrieve the selected Node. And this doesnt work. Can you help me?

     

    var treeView = $find("<%= RdTViewHierarchy.ClientID %>");

     

     

    var node0 = treeView.get_nodes().getNode(0);

     

     

    for (var i=0; i < node0.get_nodes().get_count();i++)

     

    {

     

    var node = node0.get_nodes().getNode(i);

     

     

    if (node.get_selected()) alert(node.get_text());

     

    }

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 06 Jul 2009 Link to this post

    Hi Sri,

    You can use the get_selectedNode method of RadTreeView client-object.

    Kind regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top