This is a migrated thread and some comments may be shown as answers.

Set .Selected(true) in razor

1 Answer 76 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David A.
Top achievements
Rank 1
David A. asked on 27 Oct 2011, 07:15 AM
Hi,

I am trying to set the Selected property of a menu item like so, but it is not working.  Is it possible to detect the controller and select the menu item?

Thank you,
David A.
@{ Html.Telerik().Menu()
                      .Name("Menu")
                      .Items(menu =>
                      {
                             menu.Add()
                               .Text("Profile").ImageUrl("~/Images/profile36.png")
                               .Action("Edit", "Profile")
                               .Selected(ViewContext.Controller is ProfileController);
 }).Render();
}

1 Answer, 1 is accepted

Sort by
0
David A.
Top achievements
Rank 1
answered on 27 Oct 2011, 07:35 AM
I found the answer.  It looks like there might be a .css issue with the Windows7 .highlighted class.  When I added the css class below, it worked fine.

.t-menu .t-highlighted  {
    background-color: #DEECFE;
}
Tags
Menu
Asked by
David A.
Top achievements
Rank 1
Answers by
David A.
Top achievements
Rank 1
Share this question
or