Ver Mensaje Individual
  #6  
Antiguo 22-07-2006
[jesusomarsanche] jesusomarsanche is offline
Miembro Premium
 
Registrado: may 2006
Posts: 11
Reputación: 0
jesusomarsanche Va por buen camino
ami me funciono de la siguiente forma

utilice el codigo expuesto anteriormente pero lo cambie a los eventos del grid
getcolorcelda
getcolortexto

y reviso que la columna de la celda sea la que quiero cambiar el color utilizando acol para la posicion de la columna

Código:
procedure Tfrmvalidar.grdpreprogGetColorCelda(Sender: TObject;
  Column: TColumn; ARow, ACol: Integer; AState: TGridDrawState;
  ABrush: TBrush; AFont: TFont);
begin
   if preprog.FieldByName('error').AsInteger = 1 then  begin
      if grdpreprog.Fields[acol].DisplayName = 'COMPONENTE' then begin
        grdpreprog.Canvas.Brush.Color :=claqua;
      end;
   end;
end;
procedure Tfrmvalidar.grdpreprogGetTextoCelda(Sender: TObject;
  Column: TColumn; ARow, ACol: Integer; var Texto: String);
begin
   if preprog.FieldByName('error').AsInteger = 1 then  begin
     if grdpreprog.Fields[acol].DisplayName = 'COMPONENTE' then begin
       grdpreprog.Canvas.Font.Color := clRed;
       grdpreprog.Canvas.Font.Style := [fsBold];
     end;
   end;
end;
espero te sea de utilidad
Responder Con Cita