More in this section

Forums / General Discussions / EnableSelection


2 posts, 0 answered
  1. Jaime Weise
    Jaime Weise avatar
    120 posts
    02 Nov 2008
    12 Mar 2010
    Link to this post
    Hi there,

    I am trying to get the selected class to be rendered in the resulting menu html so I can style the selected state of the menu. I wasn't able to do this so I upgraded from a sitefinity install that uses (telerik controls 2009 Q1)  to Sitefinity 3.72.(telerik controls 2009 Q3). The attribute shows up as expected on the server control but I have yet to see the rmSelected class rendered in the resultant html.

    Looking for an answer
    not found yet

  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    01 Feb 2016
    15 Mar 2010
    Link to this post
    Hello jaime,

    Can you please modify the ItemDataBound method in ~/Sitefinity/UserControls/Navigation35/SiteMenu.ascx.cs:
    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)
        CmsSiteMapNode node1 = e.Item.DataItem as CmsSiteMapNode;
        CmsSiteMapNode currentNode = (CmsSiteMapNode)SiteMap.CurrentNode;
        if (node1 == currentNode)
            e.Item.Selected = true;
        if (this.hideUrlForGroupPages)
            CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode;
            if (node != null)
                // save the PageID in the attributes of the menu item
                e.Item.Attributes.Add("PageID", node.Key);
                if (node.PageType == CmsPageType.Group)
                    e.Item.NavigateUrl = "";

    This will set the menu item representing the currently displayed page to selected. Then you need to add CSS rules for the rmSelected class.

    Kind 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.
2 posts, 0 answered