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

[Solved] Howto disable node selection in Treeview

2 Answers 166 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christian
Top achievements
Rank 1
Christian asked on 18 Apr 2011, 01:15 PM

I have a MVC3 Treeview with a predefined selected node. It should not be possible for the user to change this selection. How can I disable this behavior?

 

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 18 Apr 2011, 04:31 PM
Hello Christian,

Use the TreeView's OnSelect client handler and cancel the event:

http://www.telerik.com/help/aspnet-mvc/telerik-ui-components-treeview-client-api-and-events.html#OnSelect

function preventSelection(e)
{
    e.preventDefault();
}


Kind regards,
Dimo
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Christian
Top achievements
Rank 1
answered on 18 Apr 2011, 05:01 PM
It is working. Thanks.
Tags
TreeView
Asked by
Christian
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Christian
Top achievements
Rank 1
Share this question
or