+1-888-365-2779
Try Now
More in this section

Forums / Designing with Sitefinity / .rtSelected for second layer in menu/navigation

.rtSelected for second layer in menu/navigation

3 posts, 1 answered
  1. Roman
    Roman avatar
    20 posts
    Registered:
    20 Jan 2009
    22 Apr 2010
    Link to this post
    Hi

    I came across the following issue when I tried to give the selected item of a sublayer (in SiteTreeView) a different style:
    When an item from the first layer is selected and the page gets reloaded, the .rtSelected class is applied to the selected item. However this is not the case for a sublayer. There's a .rtSelected right after clicking it, but after the page reload is done there's no .rtSelected anymore.
    I attached a firebug-view of my menu including my item's classes.

    Please tell me how I can style the selected item in a sublayer.

    Thanks in advance for your help!
    Kind regards
    Roman
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    22 Apr 2010
    Link to this post
    Hello Roman,

    Thank you for using our services.

    Can you please open the ~/Sitefinity/UserControls/Navigation35/SiteTreeview.ascx.cs file and modify the RadTreeview1_NodeBound event handler like this:
    public void RadTreeview1_NodeBound(object o, RadTreeNodeEventArgs e)
    {
        if (this.RadTreeview1.MultipleSelect)
        {
            CmsSiteMapNode currentNode = SiteMap.CurrentNode as CmsSiteMapNode;
            if (currentNode != null && currentNode.ParentNode != null)
            {
                while (currentNode != null && currentNode.ParentNode != SiteMap.RootNode)
                {
                    RadTreeNode item2 = this.RadTreeview1.FindNodeByUrl(this.ResolveUrl(currentNode.Url));
                    if (item2 != null)
                        item2.Selected = true;
                      
                    currentNode = currentNode.ParentNode as CmsSiteMapNode;
                }
            }
        }
    }

    This should do the trick.

    Regards,
    Radoslav Georgiev
    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.
    Answered
  3. Roman
    Roman avatar
    20 posts
    Registered:
    20 Jan 2009
    22 Apr 2010
    Link to this post
    I like!

    Thanks for the prompt answer

    Kind regards
    Roman
Register for webinar
3 posts, 1 answered