Cita:
Empezado por Gydba
Fijate si este código te ayuda (Tenés que usar el evento DrawDataCell del componente):
Código:
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect; Field: TField; State: TGridDrawState);
var
iRowNumber : Integer;
begin
with (Sender as TDBGrid), Canvas do begin
iRowNumber := (Rect.Top + Rect.Bottom) div ((1+Rect.Bottom - Rect.Top)*2);
if Odd(iRowNumber) then Brush.Color := clYellow
else Brush.Color := clWhite;
FillRect(Rect);
DefaultDrawDataCell(Rect, Field, State);
end;
end;
Como dato interesante el componente rxDBGrid de las rxlib tiene propiedades un tanto mas avanzadas que el DBGrid.
|
Hola amigos, el ejemplo descrito a mi me funciono de maravilla, sin embargo cuando estas celdas tienen texto, el texto desaparece o no se puede visualizar. Por favor podrían decirme como puedo hacer???. Estoy utilizando el componente tRxDBLib.
Gracias de antemano