Expanding tree to specific node based on query string

3 posts, 0 answers
  1. Jerry
    Jerry avatar
    41 posts
    Member since:
    Mar 2012

    Posted 29 Oct 2015 Link to this post

    Hello,

     I have a page that has a treeview that lists our different zip files of data that users can download.  When the user click a zip file to download and they are not logged in they are redirected to the login page.  After they login they are redirected to the page where my zip files are listed in my treeview.  The issue now is the page reloaded and the tree is collapsed.  How can I open the tree to the specific node the user clicked on?  I can put the node text in a query string and page it back and forth but how can I take the query string and open the treeview?

     

    Thank you

  2. Jerry
    Jerry avatar
    41 posts
    Member since:
    Mar 2012

    Posted 02 Nov 2015 in reply to Jerry Link to this post

    Did I post this in the incorrect place?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ivan Danchev
    Admin
    Ivan Danchev avatar
    830 posts

    Posted 04 Nov 2015 Link to this post

    Hello Jerry,

    If you have saved the node's text in a query string you can retrieve the value in the Page_Load handler, use it to find the node and expand it as shown below:
    string node = Request.QueryString["node"];
    if (node != null)
    {
        RadTreeView1.FindNodeByText(node).Expanded = true;
    }

    Regards,
    Ivan Danchev
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top