Skip to main content

Item Link Mode

The MenuSettingsBase.ItemLinkMode property specifies how menu items are represented as links within the menu. By default, this property is set to ContentBounds, which makes the menu entirely interactive. If you need to display a simple menu (such as a set of single level links), you can set the ItemLinkMode property to TextOnly or TextAndImage. In this instance, the resulting HTML code generated to represent the menu on the page will be minimal.

The image below shows two Menus in two link modes - ContentBounds and TextOnly.

Menu_ItemLinkMode

The code sample below demonstrates how you can set the ItemLinkMode property.

@Html.DevExpress().Menu(
    settings => {
        settings.Name = "MyMenu";
        settings.ItemLinkMode = ItemLinkMode.TextOnly;

        ...

    }).GetHtml()

Note

The Styles.Link property is not in effect when used within the Menu extension for the ASP.NET MVC. As a workaround, you can define the appearance of links using CSS code.

The code sample below illustrates how to underline links when they are hovered.

<style type="text/css">
        #myMenu a:hover
        {
            text-decoration: underline;
        }
</style>

@Html.DevExpress().Menu(settings =>
{
    settings.Name = "myMenu";
    ...
}).GetHtml()