mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 03:29:28 +02:00
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:
parent
0f237c154c
commit
e677aae348
@ -719,10 +719,8 @@ begin
|
|||||||
OldFixedCols := FixedCols;
|
OldFixedCols := FixedCols;
|
||||||
OldFixedRows := FixedRows;
|
OldFixedRows := FixedRows;
|
||||||
Clear;
|
Clear;
|
||||||
ColCount := OldFixedCols + 1;
|
|
||||||
RowCount := OldFixedRows + 1;
|
RowCount := OldFixedRows + 1;
|
||||||
FixedCols := OldFixedCols;
|
ColCount := OldFixedCols + 1;
|
||||||
FixedRows := OldFixedRows;
|
|
||||||
if dgIndicator in Options then
|
if dgIndicator in Options then
|
||||||
ColWidths[0]:=12;
|
ColWidths[0]:=12;
|
||||||
end;
|
end;
|
||||||
|
@ -2667,6 +2667,8 @@ begin
|
|||||||
NewColCount := FGridPropBackup.ColCount;
|
NewColCount := FGridPropBackup.ColCount;
|
||||||
FFixedCols := Min(FGridPropBackup.FixedColCount, NewColCount);
|
FFixedCols := Min(FGridPropBackup.FixedColCount, NewColCount);
|
||||||
FFixedRows := Min(FGridPropBackup.FixedRowCount, AValue);
|
FFixedRows := Min(FGridPropBackup.FixedRowCount, AValue);
|
||||||
|
FTopLeft.X := FFixedCols;
|
||||||
|
FTopLeft.Y := FFixedRows;
|
||||||
// ignore backedup value of rowcount because
|
// ignore backedup value of rowcount because
|
||||||
// finally rowcount will be AValue
|
// finally rowcount will be AValue
|
||||||
FGridPropBackup.RowCount := AValue;
|
FGridPropBackup.RowCount := AValue;
|
||||||
|
Loading…
Reference in New Issue
Block a user