Disable Postback on RadTreeView on specific condition

2 posts, 0 answers
  1. Yefta
    Yefta avatar
    14 posts
    Member since:
    Mar 2015

    Posted 08 Oct 2015 Link to this post

    I have a RadTreeView that call OnNodeClick event, and a textbox contain "YES" or "NO"

    What i have to achieve is:

    Can i disable OnNodeClick event and postback when the textbox contain "NO"??

    can i achieve this using OnClientNodeClicking event to cancel OnNodeClick event like this?

    thank you

  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 13 Oct 2015 Link to this post

    Hello Yefta,

    You are absolutely correct - you can achieve this requirement using the following approach:
    <telerik:RadTreeView ... OnClientNodeClicking="nodeClicking">
    JavaScript:
    function nodeClicking(sender, args) {
        // custom condition
        if (args.get_node().get_text() == "Music") {
            args.set_cancel(true);
        }
    }

    Hope this helps. Please give it a try and let me know if it works for you.

    Regards,
    Eyup
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top