Pués lo he hecho y nada.
Me gustaría saber si es que este bloque (DBGrid1.DefaultDrawColumnCell(rect,DataCol,Column,State)
no permite la ejecución debido a que estoy trabando con campos tipos String.
Código Delphi
[-]
TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect:TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if table1estatus := 'finalizado' then
begin
DBGrid1.canvas.brush.color :=clBlue;
end else
DBGrid1.canvas.brush.color :=clRed;
DBGrid1.DefaultDrawColumnCell(rect,DataCol,Column,State)
End;
End;
End;
La otra forma:
Código Delphi
[-]
TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect:TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if table1estatus := 'finalizado' then
begin
DBGrid1.canvas.brush.color :=clBlue;
end else
if table1estatus := 'pendiente' then
begin
DBGrid1.canvas.brush.color :=clRed;
DBGrid1.DefaultDrawColumnCell(rect,DataCol,Column,State)
End;
End;
End;