execute NavigateURL property programatically

2 posts, 0 answers
  1. Minas
    Minas avatar
    5 posts
    Member since:
    Sep 2012

    Posted 17 Nov 2012 Link to this post

    I am using Telerik RadTreeView and I am adding Nodes programatically with the following code

         subnode.NavigateUrl = "javascript:selectedNode('" + subnode.Text + "','" + "content" + "','" + myDataReader2["moduleId"] + "')";

    Thus when i am clicking the node then the javascript function selectedNode is executed. But when I am changing the selected node programmatically by using a button for ex:

     node.Selected = true; 

    The javascript is not executed. Is there any way to execute its navigateurl property programmatically?.

  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    1966 posts

    Posted 21 Nov 2012 Link to this post

    Hello Minas,

    Setting a JavaScript function for NavigateURL property will consider executing that function when user clicks on that node. Programmatically you are able to call an existing JavaScript function using this type of expression:

                "selectednodeFn", "selectednode(" + subnode1.Text + ");", true);

    since in your case the NavigateURL is your JavaScript function.

    Boyan Dimitrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top