Can I limit the depth of the treeview?

3 posts, 0 answers
  1. e
    e avatar
    12 posts
    Member since:
    Dec 2008

    Posted 15 Sep 2009 Link to this post

    I'd like to limit the expand depth that users can see in the treeview. Is there a way to do that?

    Eric
  2. Schlurk
    Schlurk avatar
    812 posts
    Member since:
    May 2009

    Posted 16 Sep 2009 Link to this post

    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 %>"); 

  3. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 17 Sep 2009 Link to this post

    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.
Back to Top