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

Disabled but visible SiteMap menu items

2 Answers 32 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.
Shane Milton
Top achievements
Rank 2
Shane Milton asked on 11 May 2010, 11:29 PM
When using the BindTo with a SiteMap, is it possible to have a menu item be disabled yet still be visible? Whether this is done with a strikethrough, being "grayed out", or some other means, I'd like to have some ability to do this.

Thanks!

P.S. I realize if I have no controller/action on there that it will be functionally disabled, but I'd like a way to differentiate these "disabled" ones from those (which we use for parent menu nodes).

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 12 May 2010, 09:31 AM
Hi Shane Milton,

This can be easily done like this:

<%= Html.Telerik().Menu()
       .Name("Menu")
       .BindTo("sample", (item, node) =>
       {
           if (node.Attributes.ContainsKey("enabled"))
           {
               item.Enabled = Convert.ToBoolean(node.Attributes["enabled"]);
           }
       })
%>

<siteMapNode controller="menu" action="firstlook" title="First Look" enabled="false"/>


Regards,
Atanas Korchev
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.
0
Shane Milton
Top achievements
Rank 2
answered on 12 May 2010, 09:36 AM
VERY cool! :-)
Tags
Menu
Asked by
Shane Milton
Top achievements
Rank 2
Answers by
Atanas Korchev
Telerik team
Shane Milton
Top achievements
Rank 2
Share this question
or