Back to Devexpress

MenuItem.Visible Property

aspnet-devexpress-dot-web-dot-menuitem-58f92133.md

latest2.8 KB
Original Source

MenuItem.Visible Property

Gets or sets a value specifying the visibility of the current menu item.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(true)]
public bool Visible { get; set; }
vb
<DefaultValue(True)>
Public Property Visible As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if the item is visible; otherwise false.

|

Remarks

Use the Visible property of menu items to dynamically change the content of a menu. This property enables you to hide and display specific menu items when certain conditions are met.

Note that the Visible and MenuItem.VisibleIndex properties are interdependent. The false value assigned to the Visible property sets the MenuItem.VisibleIndex property to -1. Setting the Visible property back to true makes the MenuItem.VisibleIndex property set to a non-negative value it has previously.

Note

If an item’s server Visible property is set to false, the item is not rendered into the web page at all, so it can’t be manipulated on the client side.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Visible property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-web-forms-create-responsive-web-app/CS/ResponsiveWebApplication/Root.master.cs#L22

csharp
protected void HideUnusedContent() {
    LeftAreaMenu.Items[1].Visible = EnableBackButton;

See Also

VisibleIndex

Enabled

MenuItem Class

MenuItem Members

DevExpress.Web Namespace