Skip to main content

TcxGridPopupMenu.RegisterPopupMenu(TComponent,TcxGridViewHitTypes,TcxGridOnPopupProc,TcxCustomGridViewClass) Method

Registers a custom menu.

Declaration

procedure RegisterPopupMenu(const AMenu: TComponent; AHitTypes: TcxGridViewHitTypes; ADoPopupProc: TcxGridOnPopupProc; AViewClass: TcxCustomGridViewClass); overload; virtual;

Parameters

Name Type
AMenu TComponent
AHitTypes TcxGridViewHitTypes
ADoPopupProc TcxGridOnPopupProc
AViewClass TcxCustomGridViewClass

Remarks

The TcxGridPopupMenu component allows you to manage custom menus. To add or remove a custom menu at design time, use the PopupMenus collection editor. At runtime, you can call the RegisterPopupMenu and UnregisterPopupMenu methods and pass a custom menu to be added/removed as the AMenu parameter.

The AHitTypes parameter specifies the grid View elements for which the menu, activated by a mouse right-click, is assigned. Custom menus have a higher priority than built-in menus. For instance, if you assign a custom menu to a footer element, the built-in menu with summary types will be disabled.

Unlike built-in menus, custom menus are applied only to specific grid Views. You can specify the View via the AView parameter. The overloaded method allows you to apply the menu to all Views of a certain type. To accomplish this, pass the View type as the AViewClass parameter.

The new custom menu will be handled by the procedure referenced via the ADoPopupProc parameter.

See Also