How to expand all nodes ?

7 posts, 1 answers
  1. Manoj
    Manoj avatar
    75 posts
    Member since:
    Dec 2008

    Posted 15 Jan 2009 Link to this post

    Hi,
        I have implemented Load On Demand . But I want to expand the whole tree on click of a button . I am trying to use expandAllNodes() method, but it is not working . Can you tell me with an examaple how can I able to achive this ?

    Regards
    Manoj
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Jan 2009 Link to this post

    Hi Manoj,

    The ExpandAllNodes() method must work with out any issues. But it will expand only the nodes that have ExpandMode set to ClientSide. Have a look at the following help article.
    Expanding Nodes

    Thanks
    Princy

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Manoj
    Manoj avatar
    75 posts
    Member since:
    Dec 2008

    Posted 28 Jan 2009 Link to this post

    Hi Princy,
       I have implemented the Load On Deman. I have to do a search in the tree view control . Currently the search is possible only in expanded node in the tree . If your entered string is under a node then it cannot search that string in the tree view control .
            For this reason I want to expand the whole tree when I click on search button . For this reason I am thinking to call the "

    rtvDetailData_NodeExpand(

    object sender, RadTreeNodeEventArgs e)

     

    " event on button click event in a loop  . But when I am calling the rtvDetailData_NodeExpand(0,1)  it is giving error as "cannot convert from 'int' to 'Telerik.Web.UI.RadTreeNodeEventArgs" . Can you tell me how to do this .

    Regards
    Manoj
  5. Manoj
    Manoj avatar
    75 posts
    Member since:
    Dec 2008

    Posted 28 Jan 2009 Link to this post

    Hi,
        Anybody can help me out .

    Regards
    Manoj
  6. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 05 Feb 2009 Link to this post

    Hi,

    I'm dealing with a very similar problem as Manoj.

    I have a LOD treeview with a server-side population. I need to set a specific node to selected, but I cannot access it as it hasn't been loaded. So I need to be able to call the nodeExpand sub.

    If I call it from the codebehind, what would I use as object and eventargs?

    Call Tree_NodeExpand(whathere?, whathere?)

    Regards,
    -DJ-
  7. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 06 Feb 2009 Link to this post

    Hello,

    The first argument is the sender of the event - pass the treeview instance. The second is of type RadTreeNodeEventArgs - here is how to use it:

    Dim args As RadTreeNodeEventArgs = new RadTreeNodeEventArgs(nodeToExpand)

    where nodeToExpand is just that - the node instance which you wish to expand. Here is a sample invocation:

    Tree_NodeExpand(RadTreeView1, RadTreeView1.Nodes(0))

    I hope this helps,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  8. -DJ-
    -DJ- avatar
    263 posts
    Member since:
    Oct 2004

    Posted 06 Feb 2009 Link to this post

    Thanks Albert,

    That was exactly what I (and presumably Manoj) was looking for.

    Regards,
    -DJ-
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017