Hola, mira, si mal no entiendo lo que tu quieres es mostrar un DBGrid con las filas de colores alternos para tratar de identificar mejor los datos, cierto? Bueno, si la cosa es asi, esto debes hacerlo en el DBgrid y es independiente del Gestor de BD que usas. LA cosa esta en el evento OnDrawColumnCell, que se encarga de dibujar la celda y tu si lo interceptas puedes hacer que esta se dibuje tal y como quieres. Aqui te mando un degmento de codigo qeu hace lo que creo, necesitas
si no lo entiendes me lo dices y te lo comento mejor)
Código Delphi
[-]
procedure TfrmListaPedidos.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
var
X, Y, Index, RecNo: integer;
DataSet: TDataset;
Field: TField;
CellText: string;
begin
with DBGrid1.Canvas do begin
with Brush do begin
if gdFocused in State then begin
Color := clHighlight;
Font.Color := clHighlightText;
end else if gdSelected in State then begin
Color := clHighlight;
Font.Color := clHighlightText;
end else if gdFixed in State then begin
Color := DBGrid1.FixedColor;
end else begin
if DataCol = 0 then
Color := $AACCFF else begin
if DBGrid1.Datasource <> nil then begin
DataSet := DBGrid1.Datasource.DataSet;
if DataSet <> nil then begin
RecNo := DataSet.RecNo;
if RecNo = -1 then begin
RecNo := DataSet.RecordCount + 1;
if RecNo = 0 then RecNo := 1;
end;
end else
RecNo := 1;
end else
RecNo := 1;
if (RecNo And 1) = 0 then
Color := $FFFFEE else
Color := $EEFFFF; end;
end;
end;
Field := Column.Field;
if Field <> nil then begin
if Field.FieldName = 'ItemsTotal' then
if Field.AsCurrency > 10000 then
with Font do begin
Color := $FF;
Style := Style + [fsBold];
end;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end else begin
FillRect(Rect);
if DataCol = 7 then begin
CellText := 'Custom Text';
case Column.Alignment of
taRightJustify:
X := Rect.Right - TextWidth(CellText) - 2;
taCenter:
X := (Rect.Right - Rect.Left
- TextWidth(CellText)) div 2 + Rect.Left;
else X := Rect.Left + 2;
end;
TextOut(X, Rect.Top + 2, CellText);
end else if DataCol = 8 then begin
case Column.Alignment of
taRightJustify:
X := Rect.Right - 2 - 16;
taCenter:
X := (Rect.Right - Rect.Left - 16) div 2 + Rect.Left;
else X := Rect.Left + 2;
end;
Y := (Rect.Bottom - Rect.Top - 16) div 2 + Rect.Top + 1;
end;
end;
if gdFocused in State then DBGrid1.Canvas.DrawFocusRect(Rect); end;
end;
Espero te sirva.