FMXGrid and Comments

This probably more a feature request.

Maybe some of it is already possible.

Questions about added comments to a gridcell:
1. Can a Comment be added without display the little triangle ?
2. Is it possible to show/popup the comment by clicking on the cell itself
3. Is it possible to change the comment popup-properties:
    a. Popup Arrow up or down ?
    b. Thickness of the border
    c. Font of the text within the Comment Popup

Perhaps (some of) these issues can be implemented by (new) properties,

  1. The comment is always displayed with a triangle in the top right corner. Are referring to a comment that is permanently visible?
    2) Yes you can with the following code:

    procedure TForm1.TMSFMXGrid1CellClick(Sender: TObject; ACol, ARow: Integer);
      obj: TControl;
      obj := TMSFMXGrid1.GetCellObject(Cell(ACol, ARow));
      if Assigned(obj) and (obj is TTMSFMXCommentGridCell) then
        (obj as TTMSFMXCommentGridCell).ShowPopup;

    Yes you can change this with the OnGetCellProperties:

    procedure TForm1.TMSFMXGrid1GetCellProperties(Sender: TObject; ACol,
      ARow: Integer; Cell: TFmxObject);
      if Cell is TTMSFMXCommentGridCell then
        (Cell as TTMSFMXCommentGridCell).CommentPanel.CalloutPosition := TCalloutPosition.Top;
        (Cell as TTMSFMXCommentGridCell).Popup.Placement := TPlacement.BottomCenter;
        (Cell as TTMSFMXCommentGridCell).CommentText.Margins.Top := (Cell as TTMSFMXCommentGridCell).CommentPanel.CalloutLength + 2;

Thanks Pieter,

These tips are very helpful.
I managed to do everything I wanted.

Not showing the comment rectangle can be done by
   (Cell as TTMSFMXCommentGridCell).Comment.Opacity := 0;

Is there a simple way to position the Popup below/center the entire Cell (instead of the comment rectangle).
I have (sort of) accomplished this, but it required an amount of code for calculating the (absolute) position.
e.g. by setting the Popup reference control to the Cell instead of the Comment rectangle ?



You could try to change the PlacementTarget property of the Popup to the cell object in the OnCellClick event before calling the ShowPopup method.