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

Can I limit the depth of the treeview?

2 Answers 99 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
e
Top achievements
Rank 2
e asked on 15 Sep 2009, 08:21 PM
I'd like to limit the expand depth that users can see in the treeview. Is there a way to do that?

Eric

2 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 16 Sep 2009, 03:00 PM
I think the easiest way would be to get the TreeView object and then with the OnClientNodeExpanding use the .get_level() method with the node and cancel the event if it's too far down.

Snagging the TreeView from the FileExplorer would be the following code:
 var myTreeView = $find("<%= FileExplorer1.TreeView %>"); 

0
Tervel
Telerik team
answered on 17 Sep 2009, 07:53 AM
Hi all,

The RadFileExplorer provides an OnClientLoad event, which you can use.
In this event you can easily get access to the treeview by using its client-side get_tree method - and proceed further by using the RadTreeView to achieve what you need. E.g.

function OnClientLoad(sender, args)
{
   var tree = sender.get_tree();
  //TODO: Proceed further with implementing your code
}


Best wishes,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
FileExplorer
Asked by
e
Top achievements
Rank 2
Answers by
Schlurk
Top achievements
Rank 2
Tervel
Telerik team
Share this question
or