FNCGrid Row color

Hi to all,
i need to change some rows color according with a cell value.
For example

If FngGrid.Floats[ACol,ARow]<0 then the row must be red
else
if (FngGrid.Floats[ACol,ARow]>0) and (FngGrid.Floats[ACol,ARow]<50) row must be yellow
else
row must be green

With normal ADVStringGrid i have RowRolor[ARow] but here not.
How i can do it ??

Thank's for all

Daniele

Please use the OnGetCellLayout event to change the row colors.

Hi Pieter,
do you have any example on how do this ?
When i try to assign the procedure i get this error

"cannot find implementation of method fncgrid1getcelllayout"

and i don't know where i doing mistake.

This is for android application (and cosmetic purpose)

Thank's
Daneile

procedure TForm2.TMSFNCGrid1GetCellLayout(Sender: TObject; ACol, ARow: Integer;
  ALayout: TTMSFNCGridCellLayout; ACellState: TTMSFNCGridCellState);
begin
  ALayout.Fill.Color := gcRed;
end;

Hi Pieter,
thank's for your help ..
I had a stange problem with the unit .... now solved!!!
I have a new color problem.
In a grid i show the operation number and what is done in that operation.
The columns are 1=OptNumber 2=Operator ecc...
In the grid i have somthing like that

Operation Operator
1 5 (Row color beige)
1 5 (Row color beige)
1 5 (Row color beige)
2 3 (Row color White)
3 1 (Row color beige)
3 1 (Row color beige)
4 5 (Row color White)
5 2 (Row color beige)
5 2 (Row color beige)

My need is use the same color for the same operation.
I'm not able to get it with TMSFNCGrid1GetCellLayout
It seem like band but is not odd/even because it's work with the operations number (rows).

Thank's for your help

Regards
Daniele

Hi Pieter,
solved using TMSFNCGrid1.Colors[ACol,ARow] while the grid is filled

Thank's

Daniele

1 Like

Thanks for confirming the issue is fixed.