Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sorting by columns in a grid
Message
De
05/11/2004 09:17:25
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Sorting by columns in a grid
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Divers
Thread ID:
00958466
Message ID:
00958466
Vues:
61
I have a grid which the user can sort by any of the columns.

Until recently, the user did this by right-clicking to get a pop-up menu, and one of the choices allowed sorting by the selected column. The sort routine would always do a "GOTO TOP" to put the user back at the top of the newly sorted grid.

I have recently added the capability to click on the column header, which sorts immediately (no pop-up).

Since these are now duplicate capabilities, I have been asked to modify the behavior when right-clicking on one of the rows in the grid: if the user chooses the option to sort the column, he still wants the grid sorted, BUT he wants to remain on the same record that he right-clicked on.

I can't get this to work. Previously, by code looked like:
    INDEX ON bla-bla-bla
    GOTO TOP
which works properly, sending the user to the top record.

The new code, which does not work properly, looks like:
    lnRecNO=RECNO()
    INDEX ON bla-bla-bla
    GOTO (lnRecNO)
This code doesn't fail, but appears to place the user on some random record in the grid.
In fact, on some occasions, it even gets the correct record.

Any suggestions?
Thanks
Jim Nelson
Newbury Park, CA
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform