TDBAdvGrid Alternate Row Coloring

I have always used something like the below to alternate row coloring with my TCRDBGrid but the TDBAdvGrid has no DefaultDrawColumnCell, how else could I accomplish the same? I read your Developers Guide but it seems to only touch on all of the amazing amount of options that are available. Is there more detailed information available?

procedure TMainForm.MyGridDrawColumnCell(Sender: TObject;

const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);


Grid : TCRDBGrid;

Row : integer;


Grid := sender as TCRDBGrid;

Row := Grid.DataSource.DataSet.RecNo;

if not ((gdFocused in State) or (gdSelected in State)) then


      if Odd(Row) then

        Grid.Canvas.Brush.Color := OddRowColor


        Grid.Canvas.Brush.Color := EvenRowColor;




      Grid.Canvas.Brush.Color := AdvNavBar.HoverTabColorTo;


Grid.DefaultDrawColumnCell(Rect, DataCol, Column, State);


You can use banding. Make sure for columns where you want to see banding to set ShowBands = true

under grid.Columns[index]




procedure TForm1.FormCreate(Sender: TObject);


  dbadvgrid1.Bands.Active := true;

  dbadvgrid1.Bands.PrimaryColor := clgreen;

  dbadvgrid1.Bands.SecondaryColor := clred;

  dbadvgrid1.Columns[1].ShowBands := true;

  dbadvgrid1.Columns[3].ShowBands := true;


OK, Thanks!

Since I wanted the entire row I did

for I := 1 to ClientsGrid.ColCount-1 do


     if Odd(ClientsGrid.Row) then

       ClientsGrid.Columns.ShowBands := True


       ClientsGrid.Columns.ShowBands := False;