Highlighting the selected item

3 posts, 0 answers
  1. Jean
    Jean avatar
    8 posts
    Member since:
    Sep 2012

    Posted 29 Aug 2012 Link to this post

    What is the simplest way to hightlight the selected top level menu item using the Server Side Kendo Menu MVC Helper? The default behaviour does not highlight the selected item.

    All I have is

    @(Html.Kendo().Menu()
    					.Name("menu")
                                        .Items(menu =>
                                        {
                                            menu.Add().Text("Home").Action("Index""Home");
                                            menu.Add().Text("About").Action("About""Home");
                                        }).Events(events => events.Select("onSelect"))
                        )

    in my Layout.cshtml razor page. A small sample project would be ideal, if there is no simple way to hightligh the selected item.

    Any help would be appreciated.
    Thanks
    Jean
  2. Petur Subev
    Admin
    Petur Subev avatar
    1882 posts

    Posted 04 Sep 2012 Link to this post

    Hi Jean,

    There is an option called .HighlightPath(true). If you enable it the items in your menu which are related to the current URL will be highlighted.


    Regards,
    Petur Subev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Jean
    Jean avatar
    8 posts
    Member since:
    Sep 2012

    Posted 13 Sep 2012 Link to this post

    Petur,

    That does not work unfortunately. If you create a clean Kendo UI for MVC Extensions project (using the Template from nuget) and you add the method, the menu does NOT highlight your selection.

    Am I missing something? (e.g. Does the menu need a sitemap?)

    If you could provide a really simple sample I would appreciate it.

    Thanks again.
    Jean
Back to Top