El codigo es algo como esto:
private
{ Private declarations }
UnColor:TColor;
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if DataCol=0 then
if Table1Size.AsInteger>10
then UnColor:=clRed
else UnColor:=clBlack;
with (Sender As TDBGrid).Canvas do
begin
Font.Color:=UnColor;
FillRect(Rect);
TextOut(Rect.Left, Rect.Top, Column.Field.AsString);
end;
end;
|