![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
|
Filas de colores en un DBGRID
Necesito código (No un componente), para poder crear un dbgrid con filas de dos colores, como las hojas de nómina o papel caramelo, gracias.
|
|
#2
|
||||
|
||||
|
Usa el evento OnDrawColumnCell:
Código:
procedure TForm1.DBGrid1DrawColumnCell(
Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if not (gdSelected in State) then
begin
if Odd(Table1.RecNo) then
DBGrid1.Canvas.Brush.Color := clYellow
else
DBGrid1.Canvas.Brush.Color := clGreen;
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
// Saludos |
|
#3
|
|||
|
|||
|
Funciono!!!!!!
Muchas gracias!!!!!! |
![]() |
|
|
|