MenuItem.VisibleIndex Property
Gets or sets a value specifying the position of the current menu item amongst the visible items in a submenu (or at a menu’s root level).
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Description |
---|---|
Int32 | An integer value specifying the zero-based index of the MenuItem amongst visible items at the same level. -1 if the menu item is invisible. |
Remarks
Use the VisibleIndex property to control where the menu item is displayed amongst other menu items of the same menu level. If the VisibleIndex property is set to -1, the menu item is not displayed.
A particular visible menu item can be obtained by the item’s visible index using the Collection<T>.GetVisibleItem method of the parent menu item’s MenuItem.Items collection (of the ASPxMenuBase.Items collection of a menu control in case of the root level items). The total number of visible items at a particular menu level is returned by the Collection<T>.GetVisibleItemCount method of the corresponding item collection.
Note that the VisibleIndex and MenuItem.Visible properties are interdependent.The -1 value assigned to the VisibleIndex property sets the MenuItem.Visible property to false
. Setting the VisibleIndex property to a non-negative value makes the MenuItem.Visible property set to true
.