Board index » delphi » DBGRID - change colors into text of singles cells

DBGRID - change colors into text of singles cells

Hello,
          I have a problem.
It's possible to change color of text of single cell into a DBGRID
component? How?

Thank's in advance.

Giorgio

 

Re:DBGRID - change colors into text of singles cells


Yes, that is possible.
Use the OnDrawColumnCell event of TDBGrid f.e.:

procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState)
begin
  Column.Color := clRed;  {background color)
  Column.Font.Color := clYellow; {font color}
end.

Good luck
Robert
the Netherlands

Giorgio Luciani heeft geschreven in bericht <7beitg$d7...@nslave1.tin.it>...

Quote
>Hello,
>          I have a problem.
>It's possible to change color of text of single cell into a DBGRID
>component? How?

>Thank's in advance.

>Giorgio

Other Threads