Back to Devexpress

TdxCustomSpreadSheet.OnTableViewContextPopup Event

vcl-dxspreadsheetcore-dot-tdxcustomspreadsheet-f71388bd.md

latest2.0 KB
Original Source

TdxCustomSpreadSheet.OnTableViewContextPopup Event

Enables you to customize, disable, or replace the built-in popup menu invoked in a worksheet.

Declaration

delphi
property OnTableViewContextPopup: TdxSpreadSheetTableViewContextPopupEvent read; write;

Remarks

This event occurs every time a popup menu is about to appear within a worksheet area. You can assign True to the AHandled parameter within an OnTableViewContextPopup event handler to forbid a user to invoke the built-in context menu or replace it with a custom popup menu.

delphi
TMyForm.dxSpreadSheet1OnTableViewContextPopup(Sender: TdxSpreadSheetTableView; const P: TPoint; APopupMenu: TPopupMenu; var AHandled: Boolean);
begin
  MyPopupMenu.Popup(P.X, P.Y); // Invokes the custom popup menu at the mouse pointer position
  AHandled := True; // Disables the built-in context menu
end;
cpp
void __fastcall TMyForm::dxSpreadSheet1OnTableViewContextPopup(TdxSpreadSheetTableView *Sender, const TPoint &P, TPopupMenu *APopupMenu, bool &AHandled)
{
  MyPopupMenu->Popup(P.X, P.Y); // Invokes the custom popup menu at the mouse pointer position
  AHandled = true; // Disables the built-in context menu
}

Refer to the TdxSpreadSheetTableViewContextPopupEvent procedural type description for detailed information on all parameters accessible within an OnTableViewContextPopup event handler.

See Also

TdxCustomSpreadSheet.OnPageControlContextPopup

TdxCustomSpreadSheet Class

TdxCustomSpreadSheet Members

dxSpreadSheetCore Unit