Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Re-ordering Grid
Message
De
02/04/1997 11:23:41
 
 
À
01/04/1997 13:35:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00026434
Message ID:
00026575
Vues:
29
>I have a grid which lists three fields: Member, ISD, and Campus. The grid is sorted by member name, and allows the user to select a member. I want to re-order the grid by ISD or Campus if the user tabs over to one of the other fields, but preserve the record that was already selected. Re-ordering the grid is simple enough, by just changing the order and refreshing the form in the gotfocus event of the testbox in the respective grid column. The problem is that the record is not preserved. I've tried trapping the reord number before the SET ORDER and GO RECORD after, but to no avail. I tried catching the Primary key value, and then SEEKing that record again, but after the index is set, I can't SEEK on the primary key. How can I do this?


Here is an example of one way to change the record order in a grid and maintain position on the same record and maintain the same relative position in the grid.

SELECT mytable

Thisform.Grid1.SetFocus()
Thisform.LockScreen=.T.
lnrelrec=Thisform.Grid1.RelativeRow

DO WHILE Thisform.Grid1.RelativeRow>1
ThisForm.Grid1.DoScroll(1)
ENDDO

SET ORDER TO TAG mytag

DO WHILE Thisform.Grid1.RelativeRow ThisForm.Grid1.DoScroll(0)
ENDDO

Thisform.LockScreen=.F.
Thisform.Refresh()
David Lepus
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform