TDBGrid vertical scroller sometimes unexpectedly jumps to the start position
Original Reporter info from Mantis: Maxerist
-
Reporter name: Max Vlasov
Original Reporter info from Mantis: Maxerist
- Reporter name: Max Vlasov
Description:
If a dataset is sequential (report IsSequential) and user uses either vertical or horizontal scroller, the vertical scroller may temporary jump to the start position (top)
This issue appeared with my own TDataSet ancestor, when dragging and releasing the scroller led to this jump on both Windows and Linux. But I also find that a similar issue can be reproduced with project \examples\address_book\addrbook.lpi, appearing in the Lazarus image
Steps to reproduce
- run the program (addrbook)
- decrease the width of the program so the horizontal scrolling in the upper grid appears
- scroll down to some place when the vertical scroller is in the middle of the scroll area (for example when MTH_NAME=January)
- click anything in the horizontal scrolling (button or area)
Now the vertical one jumps to the top (=0). To return to normal (expected) state click at some nearby line (but not the same)
Additional information:
Looking at the sources and after some debugging I noticed that usually the problem appears when the procedure TCustomGrid.UpdateScrollbarPos is called. As I suppose TDBGrid overrides much code of TCustomGrid and don't expect many code fragments to be executed. Neverthelesss sometimes this method (TCustomGrid.UpdateScrollbarPos) is called and ScrollBarPosition from it changes the position to top (=0)