FNCGrid ColumnType ctButton

Hi all,

i'm using a FNCGrid and a TTMSFNCGridDatabaseAdapter to show data, on a WebCore Form.

I have added 3 columns, of type ctButton, to manage 3 operations on records : Copy, Paste and Edit. I use the event OnCellButtonClick to do the operations, and all is fine.

My problem is... i don't find a way to place the 3 words "Edit", "Copy", "Paste" on buttons, or to modify in some way the look of buttons (at minimum, the buttons color). I've tried almost everything.

I have looked at FNCGrid sources, and i think that what i'm tryng to do is possible, but maybe there is something that i'm missing...

Thank you, ciao

Paolo

Hi,

You can use the following code to set the button text:

procedure TForm15.TMSFNCGrid1GetCellProperties(Sender: TObject; ACol,
  ARow: Integer; Cell: TTMSFNCGridCell);
begin
  if Cell is TTMSFNCButtonGridCell then
  begin
    (Cell as TTMSFNCButtonGridCell).ButtonText := 'hello';
    (Cell as TTMSFNCButtonGridCell).ButtonWidth := 50;
  end;
end;

The button has a default appearance, it's currently not possible to change the colors.

Thank you Pieter,

it worked like a charm !

Ciao

Paolo

1 Like