Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting a grid to start displaying where you want it to.
Message
From
20/06/1999 13:12:56
 
 
To
20/06/1999 12:42:37
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00231903
Message ID:
00231919
Views:
19
>This should be simple! No relationships, just a straight flat file.
>
>I have a grid set up on page 3 of a pageframe. The grid is supposed to show, in list form, what we are viewing in detail on page 1. Which it does.
>
>The problem is that I want the first record displayed in the grid to be the current record showing on page 1. In practice it always starts at the first record on the database. How can I force it to start where I want it to? (I've tried placing a "go recnum" in both the page 3 activate event and the grid init event - where recnum is the recno() of the current record on page 1, but with no effect)
>
>Incidentally, I've had no trouble at all getting the reverse effect. i.e., when I quit the grid and go back to page 1, the record displayed in detail is the last one I selected on the grid...
>
>Suggestions?
>
>Harry

You can get a grid to locate the active row on the firdst line with some code in a grid event like:

do while this.relativerow > 1
this.doscroll(1)
enddo

YOu could put this in the grid.refresh() to have the active row always start on top, or put it in the AfterRowColChange event to have it stay on top even after the user has clicked another row.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform