Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scrolling in a grid
Message
 
To
27/02/1999 12:19:58
Senna Dwipayana
Indo Rebel Apparel Cv
Bandung, Indonesia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00192148
Message ID:
00192920
Views:
22
>Hi Peter,
>
>To know numbers of visible row in a grid
>lnNumber=INT((grid.Height-grid.HeaderHeight)/grid.RowHeight)
>
>And,
>
>>to determine the number of rows that actually have data....
>depends on the RecordSourceType that based on the grid, just count the record that actually has data (if the grid.RecordSourceType=0 or 1)
>
>
>HTH

Thanks for your reply...

This is the path I have basically taken; here are the specifics:

1. To determine the number of rows, I use a similar algorithm to the one above, but I take into account the scroll bar.
if grid.RowHeight = 0
    lnRowCount = 1  && Just in case
else
    lnRowCount = (grid.Height - grid.HeaderHeight - ;
        iif(inlist(grid.Scrollbars, 1, 3), sysmetric(8), 0) - 1) / ;
        grid.RowHeight
    lnRowCount = int(max(1, lnRowCount))
endif
2. To find the number of visible rows, I just opened the bound alias and again in another work area (so as not to disturb the original) and skipped forward to a maximum of lnRowCount to find out how many rows I can really move.

3. I encountered one other problem: The newly selected grid cell did not have its text selected like it was supposed to (when the SelectOnEntry property is true), so I sent a keyboard command:
keyboard "{ctrl+a}" clear
which works, but loses arrow keystrokes occasionaly which is not desirable...


Thanks for your help,
Peter
Peter Stephens
Visual Records, Inc.

Lead Programmer for the general purpose record keeping system Visual Records. Written primarily in VFP 6.0 with a little C++.
Previous
Reply
Map
View

Click here to load this message in the networking platform