This is a migrated thread and some comments may be shown as answers.

Disable Postback on RadTreeView on specific condition

1 Answer 57 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yefta
Top achievements
Rank 1
Yefta asked on 08 Oct 2015, 09:32 AM

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‚Äč

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 13 Oct 2015, 08:06 AM
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
Tags
TreeView
Asked by
Yefta
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or