Ver Mensaje Individual
  #2  
Antiguo 07-07-2015
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola Luis.

Si interpreté bién, creo que podrías hacer:
Código Delphi [-]
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
const
  FLAGS  = DT_SINGLELINE or DT_VCENTER or DT_CENTER;
  CELCOL : array[Boolean] of TColor = (clRed, clYellow);
var
  R: TRect;
begin
  R:= Rect;
  with TDBGrid(Sender).Canvas do
  begin
    if Column.Field = DM.SociosTIPO_CUOTA then
    begin
      Brush.Color := CELCOL[DM.SociosTIPO_CUOTA.AsString = 'EXCEDENCIA'];
      FillRect(Rect);
      DrawText(Handle, PChar(Column.Field.AsString),-1, R, FLAGS);
    end;

    if Column.Field = DM.SociosESTADO then
    begin
      Brush.Color := CELCOL[DM.SociosESTADO.AsString = 'B'];
      FillRect(Rect);
      DrawText(Handle, PChar(Column.Field.AsString),-1, R, FLAGS);
    end;

    //...
  end;
end;

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita