[DBAdvGrid] Error, if Group+HideColumn+Close


I group a DBAdvGrid. OK
Hide a column. Move, scroll,... OK.
Close the base dataset, beacuse refresh the data. I get the error.

Grid index out of range.

In AdvGrid.Pas, here:

procedure TAdvStringGrid.InsertCols(ColIndex,CCount: Integer);
  i: Integer;
  ColCount := ColCount + CCount;

  for i := ColCount - 1 + FNumHidden downto ColIndex + CCount do
    Cols := Cols[i - CCount];
    if i < ColCount then
      ColWidths := ColWidths[i - CCount];
    FVisibleCol := FVisibleCol[i - CCount];

  for i := ColIndex to ColIndex + CCount - 1 do
    ColWidths := DefaultColWidth;    
    FVisibleCol := True;
                   Error here

  for i := 0 to CCount - 1 do
    NilCol(ColIndex + i)

Delphi 7, TMS CP, XP, IBX

Thanks in advance

The error is stay in TMS C.Pack too.

If don't hide any column, everythink ok.
Hide any column: get same error.

Did you try to unhide the column before closing the dataset?

If unhide before close, everything OK.
It's a solution, i take the unhide on the datasetBeforeClose.


Do you have some sample source project with which we can reproduce this here so we can investigate this. So far, we'v been unable to see such problem here.