Select Event of RadTreeView Node ONLY on Client-Side

3 posts, 1 answers
  1. Daniel
    Daniel avatar
    159 posts
    Member since:
    Feb 2014

    Posted 22 Apr 2015 Link to this post

    Hello,

    I'm working on a project that contains a RadTreeView.

    When the user clicks on a node, it fires the JS event “OnClientClicking”.

     

    Sometimes we need to set args.set_cancel(true), in order to prevent going to server side.

    Therefore, the node that was clicked is not selected, nor is it highlighted.

    How can I prevent the event from accessing the server side – yet select the node and highlight it?

    Thanks,
    Daniel.

  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 24 Apr 2015 Link to this post

    Hello,

    You can use the following code:
    function onClientNodeClicking(sender, args) {
        args.get_node().set_selected(true);
        args.set_cancel(true);
    }


    Regards,
    Bozhidar
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Daniel avatar
    159 posts
    Member since:
    Feb 2014

    Posted 29 Apr 2015 in reply to Bozhidar Link to this post

    Hello Bozhidar,

    Thank you for your answer,
    Indeed it does the job! 

    Sincerely,
    Daniel
Back to Top