DbGrid and Pg Up/Down on empty Dataset
Original Reporter info from Mantis: Stefano
-
Reporter name: Stefano
Original Reporter info from Mantis: Stefano
- Reporter name: Stefano
Description:
Hallo,
With DBGrid I get error when the grid is empty and I press Pg Up and Pg Down.
I solved by editing the file /lcl/DbGrids.pas and adding if ValidDataSet with VK_NEXT and VK_PRIOR and after doing the rebuild Lazarus.
procedure TCustomDBGrid.KeyDown(var Key: Word; Shift: TShiftState);
[....]
VK_NEXT:
if ValidDataSet then begin //New!
doOnKeyDown;
if Key<>0 then begin
doMoveBy( VisibleRowCount );
ClearSelection(true);
Key := 0;
end;
end;
VK_PRIOR:
if ValidDataSet then begin //New!
doOnKeyDown;
if Key<>0 then begin
doMoveBy( -VisibleRowCount );
ClearSelection(true);
key := 0;
end;
end;
Best regards,
Stefano
Mantis conversion info:
- Mantis ID: 22474
- Version: 0.9.28.2
- Fixed in revision: r37995 (#9884894f)
- Target version: 1.1 (SVN)
- LazTarget: 1.2