Try Now
More in this section

Forums / Designing with Sitefinity / Highlighted menu

Highlighted menu

4 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    18 Feb 2004
    21 Sep 2007
    Link to this post
    Hello all,

    I'd like to know if there is a way to highlight the selected menuitem.
    If I navigate to a page and a postback occurs, I still like to see in my menu which item I clicked.

    Is there a css class that I can use for this? That would be the most ideal for me.

  2. Pepi
    Pepi avatar
    981 posts
    20 Oct 2016
    24 Sep 2007
    Link to this post
    Hello Daniel,

    Navigation Site Menu has a property SelectedItemCssClass that gets or sets the Cascading Style Sheet (CSS)
    class rendered by selected items of the Web server control on the client. The css class for the selected item could look like this, for example:

       font-weight: bold;
       text-decoration: underline;

    Don't hesitate to contact us if you need any further assistance.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Johnson
    Johnson avatar
    5 posts
    27 Apr 2007
    17 Dec 2007
    Link to this post

    I'm also having this problem.  I am hard coding the RadMenu into the MasterPage, but it doesn't seem to be Highlighting the selected menu item.

    <radM:RadMenu ID="RadMenu1" DataSourceID="SiteMapDataSource1"
    runat="server" SelectedItemCssClass="selectedItem" />

    This will work if I drag the Site Menu onto the page, but not when I hard code it.  I'm pretty sure I'm doing it wrong, can someone help me?

  4. Sean
    Sean avatar
    271 posts
    31 May 2006
    17 Dec 2007
    Link to this post

    What you are trying to achieve isn't handled automatically, by simply adding a RadMenu and binding it to the Menu to a Sitemap it doesn't set the SelectedItem and thus the css never gets rendered for it.  This has to be done through code.  This is why I would recommend you either use the same code as found it /Sitefinity/UserControls/Navigation/SiteMenu.ascx or just drop that control onto your master page instead.  If you look in the code behind for that file you will see in the  RadMenu1_ItemDataBound  void how it sets the selected item.  Once you are able to view your render HTML and can see the selectedItem css class is being rendered then you will know it is a css issue or something else.

    Hope that give you a push in the right direction.

Register for webinar
4 posts, 0 answered