Forum > LCL

DBGrid Scrollbar moves only in 3 positions

(1/1)

thehidden:
Hi,
I don't know if it comes from the DBGrid or from the database engines, but I the scrollbar is moving only in 3 positions

First record:                   Scrollbar on top
All other records:           Scrollbar in the middle, fixed size
Last record:                   Scrollbar on bottom

Any idea how to change it to a "normal" moving scroll bar which moves around and show you position in the list?

Thank you.

EDIT:
Looks like I have found the source of the problem. the Datasource returns always a 1 for the selected row.

krzynio:
Hi!
I'm also looking for a solution. Is it possible to redesign the DBGrid and make the vertical scrollbar height proportional to the number of records and change its position proportional to the position of the current record in the dataset?

paweld:
DBGrig will only work as expected if all records from the current query are retrieved.

This can be enforced by increasing the PackedRecords property to such a large number that it always fetches all records, such as 1000000 (or more).
The only thing is that then it will take longer to execute the query (depending on the database performance, number of records, number of columns and their data size), because every time you open/refresh the DataSet, all the data will be retrieved, not 10, as by default.

Navigation

[0] Message Index

Go to full version