TcxPopupMenuInfo.OnPopup Event
Occurs when a user right-clicks the grid View element associated with the popup menu.
Declaration
property OnPopup: TcxGridOnPopupProc read; write;
Remarks
This event occurs every time an end-user right-clicks the grid View element associated with the current object. To associate the grid View with the object, set the corresponding flag within the HitTypes property. Keep in mind that the menu added to the TcxPopupMenuInfos collection will not appear on a right-click until you add the following code into the OnPopup event handler:
procedure TForm1.cxGridPopupMenu1PopupMenus0Popup(ASenderMenu: TComponent; AHitTest: TcxCustomGridHitTest; X, Y: Integer);
begin
//...
PopupMenu1.Popup(X, Y);
//...
end;
The code shown above assumes that you have an application with a TcxGridPopupMenu component named cxGridPopupMenu1 and the TPopupMenu component named PopupMenu1.
The AHitTest parameter value identifies the right-clicked grid element. Use the ASenderMenu parameter to access the popup menu associated with this grid element.