![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#5
|
|||
|
|||
|
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; |
|
|
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 |
|