Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieve top record in a grid
Message
De
30/12/2010 13:22:18
 
 
À
30/12/2010 12:10:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01494160
Message ID:
01494174
Vues:
66
>>>i have a grid in a form showing some records from a cursor
>>>
>>>now i also have another independent vfp exe running on another monitor where a form is to show the exact same records.
>>>
>>>
>>>Is there a way to get to know what records are shown in a grid
>>>If I can retrieve the current row I could skip back to the top rocord shown.
>>>
>>>Is that possible
>>>
>>>
>>>Peter
>>
>
>they both stay at 0
>what are they supposed to be doing
>
>Peter

The only way I know how to make two VFP exes "talk" to each other is by sharing information in a table. I don't doubt that there are ways to do it better, but I don't know them.

With this in mind and assuming that the second exe can replicate the recordsource for the grid in the first exe.........

The afterRowColumnChange method in the grid in the first exe can write its ActiveRow and Relative Row to a table the second exe can read. The second exe could do something like
SELECT infotable
lnActiveRow = nActiveRow
lnRelativeRow = nRelativeRow

SELECT (mygrid.recordsource)
GOTO lnActiveRow - lnRelativeRow + 1

myGrid.refresh
It probably needs some tweaking (especially if there are filters and/or indexes on the recordsource) and is completely untested but I think that should make the two grids display the same set of records.

If not (and I certainly wouldn't be surprised to find it doesn't) I hope somebody else can come with something useful for you. I'll be interested in better solutions.

Good Luck...........Rich
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform