MenuItem Class
Represents an individual menu item within menu controls.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v21.1.dll
NuGet Package: DevExpress.Web
Declaration
public class MenuItem :
CollectionItem,
IEnumerable,
IHierarchyData,
ISupportSvgImageRendering
Related API Members
The following members return MenuItem objects:
Remarks
The MenuItem class implements the functionality of an individual menu item within a control of the ASPxMenu or ASPxPopupMenu type. Instances of the MenuItem class are maintained within the MenuItem.Items of each parent menu item and within a menu control’s ASPxMenuBase.Items collection which holds the root menu items. Individual menu items can be accessed and manipulated (added or deleted) by using the means provided by the MenuItemCollection class which is exposed via these Items properties.
Use the properties of the MenuItem class to specify the appearance and behavior of an individual menu item. You can define the MenuItem.Text, MenuItem.Image, MenuItem.ToolTip and MenuItem.Visible properties to specify the item’s caption text, image displayed in the item, the tooltip and visibility state. Specify the MenuItem.NavigateUrl and MenuItem.Target properties to set the URL the client web browser navigates to when an end user clicks the item and the window or frame in which to display the content.
Note that the MenuItem class has a client-side equivalent - an object of the ASPxClientMenuItem type.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the MenuItem class.
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.