Ver Mensaje Individual
  #3  
Antiguo 10-02-2008
Avatar de gluglu
[gluglu] gluglu is offline
Miembro Premium
 
Registrado: sep 2004
Ubicación: Málaga - España
Posts: 1.455
Reputación: 21
gluglu Va por buen camino
Deberías buscar más en los foros tal y como comenta también nuestro amigo Delphius.

No obstante, te expongo directamente aquí el codigo que precisas para colorear el DBGrid tal y como expones :

Código Delphi [-]
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
  If (not (gdSelected in State)) and (DataSet1.Recno mod 2 = 0) and (not DataSet1.IsEmpty) then
    DBGrid1.Canvas.Brush.Color := $00FFEFCA;
  DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;

Utiliza el evento OnDrawColumnCell del DBGrid. Y por defecto le indicas como color al DBGrid en su propiedad Color el otro color que indicas :

Código Delphi [-]
DBGrid1.Color := $00FFFAF0;

DataSet1 es el DataSet asociado al DBGrid.

Saludos.
__________________
Piensa siempre en positivo !
Responder Con Cita