Change Color of a single cell in the wwDBGrid Footer
I can see how I can use FooterColor and FooterCellColor of a wwDBGrid to change color but the properties apply to the entire footer and All the cells of the footer respectively.
Is there a way to change the color of a specific cell in the wwDBGrid Footer?
-
Unfortunately this is not seamlessly supported. I will log this for the future. As a workaround I believe the following will work as the current code allows you to override the color only in this case.
Assign your FooterCellColor property to something besides clBtnFace.
Then use the OnDrawFooterCell event with something like the following code.
procedure TBitmapForm.InvoiceGridDrawFooterCell(Sender: TObject; Canvas: TCanvas; FooterCellRect: TRect; Field: TField; FooterText: string; var DefaultDrawing: Boolean); begin if Field.FieldName='Total Invoice' then Canvas.Brush.Color:= clRed; end;
Please sign in to leave a comment.
Comments
2 comments