ComponentOne List 8.0 for ActiveX
Calibrating the vertical scroll bar in modes 1 and 2

When the list displays a vertical scroll bar, the scroll box indicates the ordinal positions of the records being displayed, and users expect to be able to drag the scroll box to quickly locate the desired records.

In order for the scroll box to function properly, both the total number of rows and the ordinal position of the first displayed row must be known, or at least approximated. Unfortunately, one or both of these quantities are often unavailable to the list, especially in unbound modes.

Since data is supplied and maintained by the application code, the list does not generally know the total number of rows in the data source. Also, when the list is instructed to position to a particular record, as in an assignment to its Bookmark property, the list does not generally know the ordinal position of the assigned bookmark, which may have been obtained through a find or seek operation.

Unless you compensate for these unknowns, the vertical scroll bar may behave unpredictably. To avoid this, you need to supply the list with the total number of rows in the data source (or an approximate total), and the ordinal position of the first displayed row (or an approximate position).

To provide the total row count, you can set the list's ApproxCount property:

Example Title
Copy Code
TDBList1.ApproxCount = TotalRows ' Set approximate row count

To provide the ordinal position of the first displayed row in DataMode 1 - Unbound, write a handler for the UnboundGetRelativeBookmark event.

To provide the ordinal position of the first displayed row in DataMode 2 - Unbound Extended, set the ApproximatePosition argument within the handler for the UnboundReadDataEx event.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback