Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to ensure selected row always appears at top of grid
Message
 
 
To
29/09/2000 11:37:28
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00422580
Message ID:
00422635
Views:
16
>>When I move my record pointer (with a seek etc) in a table that has a grid attached, I want the record I to appear at the top of the grid.
>>
>>At present the record will appear in the grid but not neccesarily at the top of the grid.
>>
>>Restricting the records that are displayed in the grid is not an option with this app.
>>
>>Does anyone know how to do this.
>>
>>I seem to remember having this problem with the old BROWSE command as well, I cured it then but don't know how to do the same for grids:(
>
>
Mark,
>Sample code :
>
SELECT customer
>LOCATE for at(trim(this.value),Contact)>0
>thisform.lockscreen = .t.   && If want to hide scroll animation
>WITH ThisForm.Grid1
>  .setfocus                 && Needed for relativerow
>  DO while .relativerow # 1 && Hit top row ?
>    .doscroll(1)            && Scroll down
>  ENDDO
>ENDWITH
>thisform.Text2.setfocus     && Get focus back to somewhere outside grid
>thisform.lockscreen = .f.
Cetin

Cetin,

I got this code while ago from here, but haven't tried yet, so can not guarantee, if it works.
thisform.lockscreen=.t.
with this
     nHeight = .height
     .height = .headerheight + .rowheight
     .refresh
     .height=nHeight
endwith
thisform.lockscreen=.f.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform