Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #5  
Antiguo 23-01-2006
josem josem is offline
Miembro
 
Registrado: mar 2004
Posts: 23
Poder: 0
josem Va por buen camino
Pintar una fila en un DbGrid

Hola, espero que este ejemplo te sirva.

Saludos
Jose Miguel

procedure TFMntInventario.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
var
iDif : Extended;
iFile: Extended;
begin
// Cambia color a Existencia por debajo del minimo
if ( Dt1.TInventario.FieldByName('ExistAct').AsInteger <
Dt1.TInventario.FieldByName('ExistMin').AsInteger ) then begin
DBGrid1.Canvas.Font.Color := clRed;
end;

// Cambia color a inventario inactivo
if ( SoloNumeros(Dt1.TInventario.FieldByName('Activo').AsString, 0) = '0' ) then begin
DBGrid1.Canvas.Font.Color := clSilver;
end;
if ( FCampoJPG( Dt1.TInventario, 'ActivaVencto' )) then begin
iDif := StrToDate(FormatFecha(Dt1.TInventario.FieldByName( 'FecVcto' ).AsString)) - Date;
iFile := StrToInt(SoloNumeros(Dt1.TInventario.FieldByName( 'AvisoVcto' ).AsString, 0));
// Cambia color a inventario vencido
if ( SoloNumeros( Dt1.TInventario.FieldByName('ActivaVencto').AsString, 0) = '1' ) then begin
if ( Abs( iFile ) >= iDif ) then begin
DBGrid1.Canvas.Brush.Color := $004080FF;
end;
end;
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
problema cambiar formato de fila en dbGrid VRO OOP 4 01-10-2004 17:38:52
Cambiar la tecla Tab en un DBGrid Mariano Varios 2 15-09-2004 19:57:26
Cambiar Color una Celda del DbGrid Rabata Varios 5 02-09-2004 09:31:01
como cambiar una fila seleccionada por otra en un DBgrid ? TURING Varios 1 04-08-2004 04:52:01
Cambiar el valor de una celda en DBGrid Aura OOP 8 25-05-2004 23:38:13


La franja horaria es GMT +2. Ahora son las 05:53:02.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi