Search code examples
delphiscrolldatasetmousewheeldbgrid

Smoothly TDBGrid scrolling


I want to make the TDBGrid scrolling "smoother" to scroll the page instead of row by row (dataset cursor).

I know that the navigation occurs on the dataset and not in the visual grid.

Found this old post that works through vertical scrollbar but don't work with mouse wheel scrolling.

The closer is on this post.


Solution

  • As I working with internal custom grid component (very similar to TDBGrid) I've done a solution working with the scrollbars events (vertical and horizontal) and mousewheel event so I handle by my own the scrolling skiping the Vcl common scroll.

    This way I able to simulate web-based grids that scrolls horizontaly when has shift state without even touching in dataset cursor.