1

I am working on TAdvColumnGrid where I am facing one issue with the PopupMenu. I have assign a Popup Menu to the Grid. When the cell in the grid is selected/focused then on right click of Mouse button I can show the PopupMenu.

but if the column cell is in edit mode and I clicked right mouse button then the default windows Popup appear.

I want same popup to be shown as it is showing on cell selection.

Please find the below images of both the popup. Popup 1 and default Popup

please let me know if any more information is needed.

Thanks and regards, Ankit Balbudhe

A B
  • 1,461
  • 2
  • 19
  • 54

1 Answers1

2

You havent't mentioned version that you use. But for example for TAdvColumnGrid version 3.1.3.9 you could override the CreateEditor method:

type
  TAdvColumnGrid = class(AdvCGrid.TAdvColumnGrid)
  protected
    function CreateEditor: TInplaceEdit; override;
  end;

implementation

{ TAdvColumnGrid }

function TAdvColumnGrid.CreateEditor: TInplaceEdit;
begin
  Result := inherited;
  if Result is TAdvInplaceEdit then
    TAdvInplaceEdit(Result).PopupMenu := PopupMenu; { ← assign to editor popup menu }
end;
Victoria
  • 7,822
  • 2
  • 21
  • 44
  • Thanks @Victoria. This works for me. I am using TMS version 3.1.4.4. Is this resolved in the newer version of TMS? – A B Jul 26 '18 at 04:14
  • 1
    You're welcome! Well, I wouldn;t say so. It's not actually a bug. Besides, they mention in the [TAdvStringGrid developers guide](http://www.tmssoftware.biz/download/manuals/TMS%20TAdvStringGrid%20Developers%20Guide.pdf) FAQ _"I want to override the popup menu of the default grid inplace editor"_ how to do the same without intercepting the control. – Victoria Jul 31 '18 at 09:21