Cell Coloring
Cell Coloring
The getting started documentation alludes to individual cell coloring but doesn't give any code specifics. How do I change the color of a specific cell using Delphi?
Re: Cell Coloring
Hello,
You can use the column OnPaint event as follows:
You can use the column OnPaint event as follows:
Code: Select all
TeeGrid1.Columns[2].OnPaint:=GridOnPaintColumn;
Code: Select all
procedure TFormGridDataset.GridOnPaintColumn(const Sender:TColumn; var AData:TRenderData; var DefaultPaint:Boolean);
begin
if AData.Row=1 then
with (Sender.Render as TTextRender) do
begin
Format.Brush.Visible:=True;
Format.Brush.Color:=clRed;
Paint(AData);
end
else
DefaultPaint:=True;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |