LCL, fix dbgrid index out of bounds (-1) when the selected record is not the first and the dataset is closed and opened

git-svn-id: trunk@28484 -
This commit is contained in:
jesus 2010-11-25 20:25:17 +00:00
parent 0f237c154c
commit e677aae348
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;