RadTreeView Next and Previous buttons

3 posts, 0 answers
  1. Ted
    Ted avatar
    47 posts
    Member since:
    Jan 2008

    Posted 29 Aug 2011 Link to this post

    what is the best way to implement a Previous and Next button for a Load on demand treeview?  bascially I have a treeview on the left hand side of the screen that when a node is clicked it loads on the right hand side of the tree.  basically the way you do in your documentation.  http://www.telerik.com/help/aspnet/treeview/tree_loadondemand.html

    they just want a forward and previous button on the right hand side to move up and down the tree that way. 
  2. Plamen
    Plamen avatar
    2723 posts

    Posted 31 Aug 2011 Link to this post

    Hello Ted,

    If I understand you correct, you need a button to help you expand the RadTreeview when using LoadOnDemand. Please find below a sample code that I added to the demo. It affects the ServerSide tree and expands the selected node:

    <telerik:RadButton ID="RadButton1" runat="server" onclick="RadButton1_Click" Text="Expand selected node">

    protected void RadButton1_Click(object sender, EventArgs e)
            RadTreeNode selecetdNode = RadTreeView2.SelectedNode;
            if (selecetdNode.Nodes.Count == 0)
                DataTable data = GetChildNodes(selecetdNode.Value);
                foreach (DataRow row in data.Rows)
                    RadTreeNode node = new RadTreeNode();
                    node.Text = row["Title"].ToString();
                    node.Value = row["CategoryId"].ToString();
                    if (Convert.ToInt32(row["ChildrenCount"]) > 0)
                        node.ExpandMode = TreeNodeExpandMode.ServerSide;
                selecetdNode.Expanded = true;

    Hope this helps.

    Kind regards,
    Plamen Zdravkov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft R3 2016 release webinar banner
  4. chau minh tuan
    chau minh tuan avatar
    1 posts
    Member since:
    Feb 2010

    Posted 28 Dec 2011 Link to this post

    I also encountered similar cases 
Back to Top