Right click event for Fixed cells in TTMSFMXGrid

The TTMSFMXGrid has an OnFixedCellClick event for left clicks and the grid itself has a PopupMenu property that responds to a right-click on the whole grid, but I can't see a way to respond to a right-click on a Fixed cell.  Is there a way to do this?

thanks
Jay

If you want to achieve this, you'll need to assign an event handler to the OnMouseDown event of the grid cell. 


procedure TForm1.TMSFMXGrid1GetCellProperties(Sender: TObject; ACol,
  ARow: Integer; Cell: TFmxObject);
begin
  if TMSFMXGrid1.IsFixed(ACol, ARow) then
    (Cell as TTMSFMXGridCell).OnMouseDown := DoCellMouseDown;
end;

This way, you'll be able to execute a different action when right-clicking the fixed cell.

That's great Pieter - thanks.

Two related questions
1.  Why can't I cast Cell to TTMSFMXFixedGridCell when it is Fixed?
2.  TTMSFMXGridCell has a PopupMenu property - is it possible to activate this?

  1. Not all fixed cells are of type TTMSFMXFixedGridCell.
    The left column are normal cells with a fixed appearance. The top row are cells of type TTMSFMXFixedGridCell which has access to various kinds of controls such as button, checkbox, filter button, ... Except for additional functionality there is no difference between a normal fixed styled cell and a real fixed cell. In both cases you can cast it to TTMSFMXGridCell. If you only want the top row of fixed cells you should change the code to:

    procedure TForm1.TMSFMXGrid1GetCellProperties(Sender: TObject; ACol,
      ARow: Integer; Cell: TFmxObject);
    begin
      if Cell is TTMSFMXFixedGridCell then
        (Cell as TTMSFMXFixedGridCell).OnMouseDown := DoCellMouseDown;
    end

    2) The grid consumes the events, you should use the PopupMenu of the grid itself or manually call the popupmenu for each cell in the OnMouseDown event of the grid and a combination of TMSFMXGrid.XYToCell to retrieve the cell at specific grid coordinates

Once again, that's very helpful.  Thank you.