diff --git a/lcl/dbgrids.pas b/lcl/dbgrids.pas index 82ce28cf6c..7d1d92b7cc 100644 --- a/lcl/dbgrids.pas +++ b/lcl/dbgrids.pas @@ -719,10 +719,8 @@ begin OldFixedCols := FixedCols; OldFixedRows := FixedRows; Clear; - ColCount := OldFixedCols + 1; RowCount := OldFixedRows + 1; - FixedCols := OldFixedCols; - FixedRows := OldFixedRows; + ColCount := OldFixedCols + 1; if dgIndicator in Options then ColWidths[0]:=12; end; diff --git a/lcl/grids.pas b/lcl/grids.pas index d6b0853e6c..37e4dfa8b7 100644 --- a/lcl/grids.pas +++ b/lcl/grids.pas @@ -2667,6 +2667,8 @@ begin NewColCount := FGridPropBackup.ColCount; FFixedCols := Min(FGridPropBackup.FixedColCount, NewColCount); FFixedRows := Min(FGridPropBackup.FixedRowCount, AValue); + FTopLeft.X := FFixedCols; + FTopLeft.Y := FFixedRows; // ignore backedup value of rowcount because // finally rowcount will be AValue FGridPropBackup.RowCount := AValue;