Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find which record shows first in a grid
Message
From
10/10/2012 15:25:46
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01554683
Message ID:
01554723
Views:
44
>>>>Is there a way to find which record shows in the first row of a grid? RECNO() would be fine.
>>>>
>>>>TIA,
>>>>
>>>>Alex
>>>
>>>It depends of the current ORDER.
>>>Maybe the MIN() value of the order KEY?
>>>or even:
>>>
>>>SELECT GridRecordSource
>>>GO TOP
>>>lnTOPRecNo = RECNO()
>>>
>>>
>>>but you should change it everywhere you change the current order of that table.
>>
>>Thank you for the response Borislav.
>>
>>That doesn't return the number of the record that *appears* at the top of the grid. It doesn't necesarily mean the first record on the table order, but the first one that is visible at the top of the grid. What I need is similar to grd.LeftColumn, but for rows.
>>
>>Thanks,
>>
>>Alex
>
>:-)
>Then Tore is really a mind reader :-)

I knew you would say that!

>You cold get Grid.RelativeRow and do the calculations:
>
>lnRecNo = RECNO("GridRecordSource")
>IF Grid.RelativeRow > 1
>   lnFirstVisibleRow = (Grid.RelativeRow - 1)
>   SKIP -lnFirstVisibleRow IN GridRecordSource
>   lnFirstVisibleRow = RECNO("GridRecordSource")
>   GO TO lnRecNo IN GridRecordSource
>ELSE
>   lnFirstVisibleRow = lnRecNo
>ENDIF
>
>
>NOT TESTED!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform