Skip to main content
Tab

ASPxMenuBase.ItemCommand Event

Fires when a control contained within a templated menu item raises the Command event.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public event MenuItemCommandEventHandler ItemCommand

Event Data

The ItemCommand event's data class is MenuItemCommandEventArgs. The following properties provide information specific to this event:

Property Description
CommandArgument Gets the argument for the command. Inherited from CommandEventArgs.
CommandName Gets the name of the command. Inherited from CommandEventArgs.
CommandSource Gets an object representing the control which forced a postback.
Item Gets an item object related to the event.

Remarks

A menu control (which can be either the ASPxMenu or ASPxPopupMenu) allows the contents of its menu items to be customized through defining templates. A template of a menu item can be specified by using the following properties: the ASPxMenuBase.ItemTemplate, ASPxMenuBase.SubMenuTemplate, MenuItem.SubMenuTemplate and MenuItem.Template. A template is a set of HTML elements and controls which constitute a layout for a particular menu item.

The ItemCommand event is fired when the control contained within a templated menu item raises the Command event. The ItemCommand event is commonly used when a specific command name is associated with a button control. This allows you to create multiple button controls within different templated menu items and programmatically determine which button control is clicked.

Write an ItemCommand event handler to perform specific actions each time the Command event is raised by the control contained within any templated menu item. The ItemCommand event provides a parameter of the MenuItemCommandEventArgs type.

See Also