More in this section
Forums / Bugs & Issues / Treeview select state is not changing

Treeview select state is not changing

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
6 posts, 0 answered
  1. Ian
    Ian avatar
    5 posts
    Registered:
    27 Jul 2010
    23 Aug 2010
    Link to this post
    I have a page group consisting of 3 pages. I have placed a site treeview control on the page (sitefinity_usercontrols_navigation35_sitetreeview_ascx) with the follow properties set:
    showStartingNode = False
    startFromCurrentNode = True
    StartingNodeOffset = -1

    This then shows all the pages in the page group, however when I click and go to the 2nd page in the group the rtSelected class is on the 1st page in the group even when I am viewing the 2nd.

    Please can you help me fix this?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    23 Aug 2010
    Link to this post
    Hello Ian,

    You can add the following js code in SiteTreeView.ascx

    function pageLoad() {
           var tree = $find("<%= RadTreeview1.ClientID %>");
           if (tree) {
               var location = window.location.pathname;
               location = location.substring(location.lastIndexOf('/') + 1);
               var nodeText = location.split('.');
               var currentNode = tree.findNodeByText(nodeText[0]);
               if (currentNode) {
                   currentNode.set_selected(true);
                   
               }
     
           }



    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Ian
    Ian avatar
    5 posts
    Registered:
    27 Jul 2010
    24 Aug 2010
    Link to this post
    Hi,

    Thanks for you quick rersponse, is there a server side fix for this?

    Cheers Ian
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    24 Aug 2010
    Link to this post
    Hello Ian,

    You can add the code below inside OnDataBound

    public void RadTreeview1_Bound(object o, EventArgs e)
      {
          var n = SiteMap.CurrentNode as CmsSiteMapNode;
          if (n != null && n.Parent.PageType == CmsPageType.Group)
          {
              RadTreeNode rtn = RadTreeview1.FindNodeByText(n.Title);
              if (rtn != null)
              {
                  rtn.Selected = true;
              }
          }
     
      }


    Regards,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Ian
    Ian avatar
    5 posts
    Registered:
    27 Jul 2010
    24 Aug 2010
    Link to this post
    Thanks Ivan,

    Could elaborate a bit more as I am not a .net developer

    Thanks Ian
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    24 Aug 2010
    Link to this post
    Hello Ian,

    Please take a look at RadTreeView for ASP.NET AJAX

    Regards,
    Ivan Dimitrov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
6 posts, 0 answered