Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reposition Grid based on rows
Message
From
23/06/1999 22:45:46
 
 
To
23/06/1999 18:30:31
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00233160
Message ID:
00233314
Views:
28
>>Hello Everybody.
>>
>>I've got a grid class right. Well sometimes the grid has only less rows than visible rows in the grid. My form remembers the last record and order before it was closed last. So if I goto the 2nd record of a grid in the init of an custom object, the grid starts on reord two with the third below it and the first above it off the screen and you need to move up to see it.
>>
>>So I want it if there are less rows than total visble rows (filled and blank ones) we just see all of the rows keeping the second or what ever as active.
>>
>>I thought the I could determine the visible rows by dividing the total hieght minus the header hieght by the row height, than determing if there are less filled rows than visble rows then move the grid up. If this is the best method how do I move the grid up but keep the active row the same?
>
>Something like:
>IF reccount('mytable')<6 && or some other number, or use COUNT if you have deleted records
>Thisform.Mygrid.DoScroll(2)
>ENDIF

Thanks Edward

That doscroll is what I was missing. I did this code at startup and whenever I change the order by clicking on colunm header:


lparam tcTable

if !empty(tcTable)
lcSel=Alias()
select (tcTable)
if (This.height - This.headerheight)/This.rowheight > reccount()
This.DoScroll(2)
endif
select (lcSel)
endif
Previous
Reply
Map
View

Click here to load this message in the networking platform