Skip to main content
A newer version of this page is available. .
Tab

ASPxGridView.ContextMenuItemVisibility Event

Enables you to dynamically change the visibility and availability of context menu items.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public event ASPxGridViewContextMenuItemVisibilityEventHandler ContextMenuItemVisibility

Event Data

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

Property Description
Items Gets the collection of items in the context menu.
MenuType Gets the currently displayed context menu‘s type.

The event data class exposes the following methods:

Method Description
SetEnabled(GridViewContextMenuItem, GridViewColumn, Boolean) Allows you to set the availability of a particular item based on the right-clicked column.
SetEnabled(GridViewContextMenuItem, Boolean) Allows you to set the availability of a particular item.
SetEnabled(GridViewContextMenuItem, Int32, Boolean) Allows you to set the availability of a particular item based on the right-clicked row.
SetVisible(GridViewContextMenuItem, GridViewColumn, Boolean) Allows you to set the visibility of a particular item based on the right-clicked column.
SetVisible(GridViewContextMenuItem, Boolean) Allows you to set the visibility of a particular item.
SetVisible(GridViewContextMenuItem, Int32, Boolean) Allows you to set the visibility of a particular item based on the right-clicked row.

Remarks

The ContextMenuItemVisibility allows you to hide/show and disable/enable context menu items. You can use the event parameter’s properties to access the collection of context menu items (ASPxGridViewContextMenuItemVisibilityEventArgs.Items) and get the displayed menu type (ASPxGridViewContextMenuItemVisibilityEventArgs.MenuType).

Event parameter provides the ASPxGridViewContextMenuItemVisibilityEventArgs.SetVisible and ASPxGridViewContextMenuItemVisibilityEventArgs.SetEnabled methods that allows you to change an item visibility and availability based on the right-clicked row or column.

See Also