RadTreeView Click from javascript

3 posts, 0 answers
  1. Dbi
    Dbi avatar
    1 posts
    Member since:
    Jul 2012

    Posted 02 Jul 2012 Link to this post

    hi, is there a way to simulate a treenode click event from the client side (from javascript)?

    e.g. I can do the following in the javascript on the client side:

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

    var selectedNode = treeView.get_selectedNode();

    alert(selectedNode.get_text());

    selectedNode.expand();


    Is there a way to fire a node click event from the javascript?

    Thanks,
    dbi
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Jul 2012 Link to this post

    Hi Dbi,

    I suppose you want to assign event handlers in client-side code for RadTreeNode click. Please take a look into the following code snippet.

    JS:
    <script type="text/javascript">
    function OnClientLoad(sender,args) {
            var treeView = $find("<%= RadTreeView1.ClientID%>");
            treeView.add_nodeClicked(ClientNodeClicked);
        }
        function ClientNodeClicked(sender, args) {
            //node clicked event
        }
    </script>

    Hope this helps.

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sawyer
    Sawyer avatar
    1 posts
    Member since:
    Nov 2012

    Posted 08 Jan 2013 Link to this post

    I think you could try this 
    var treeView = $find("<%=RadTreeView1.ClientID%>");

    var selectedNode = treeView.get_selectedNode();


    selectedNode.select()
Back to Top