Ver Mensaje Individual
  #2  
Antiguo 03-07-2008
[coso] coso is offline
Miembro Premium
 
Registrado: may 2008
Ubicación: Girona
Posts: 1.678
Reputación: 0
coso Va por buen camino
Hola, debes usar el evento OnDrawCell o OnDrawColumnCell

Código Delphi [-]

procedure T_lfact.DBGrid1DrawColumnCell(Sender : TObject; const Rect : TRect;
     DataCol : Integer; Column : TColumn; State : TGridDrawState);
var
    md,ms : integer;
begin
     if Column.Field = nil then begin inherited; exit; end;

     if condicion then
     begin
          inherited;
          DBGrid1.Canvas.Brush.Color := clRed;
          DBGrid1.Canvas.FillRect(Rect);
     end;

     md := Rect.Left + ((Rect.Right - Rect.Left) div 2) -
          (DBGrid1.Canvas.TextWidth(data) div 2);
     ms := Rect.Top + ((Rect.Bottom - Rect.top) div 2) -
          (DBGrid1.Canvas.TextHeight(data) div 2);
     DBGrid1.Canvas.TextOut(md, ms, data);
end;
Responder Con Cita