Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Grid Record Order on the fly
Message
De
15/07/2009 04:47:53
 
 
À
14/07/2009 16:48:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01412342
Message ID:
01412444
Vues:
78
I am trying to sort rows in my grid by clicking on a header. The table is small, so I index it in the click methodt of each header. The index order is ignored. I know what I am doing, but what am I *supposed* to be doing??

Here is the code that does the sorting in my sortable grid class - HTH:
LOCAL lnRecNo
*** if we have a field - let's sort
IF NOT EMPTY( This.cSortField  )
  *** There seems to be a refresh issue here
  *** because even though the data is in the cursor
  *** it is not showing up in the grid after the sort
  *** and it looks like it is related to AllowCellSelection being .F.
  This.AllowCellSelection = .F.
  This.Refresh()
  KEYBOARD '{CTRL+TAB}'
  
  lnRecNo = RECNO( This.RecordSource )
  *** Go ahead and set the order for the table
  SELECT ( This.RecordSource )
  IF NOT EMPTY( This.cSortOrder )
    SET ORDER TO ( This.cSortField ) DESCENDING 
  ELSE
    SET ORDER TO ( This.cSortField ) 
  ENDIF
  This.SetFocus()
  IF lnRecNo # 0
    GO lnRecNo IN ( This.RecordSource )
  ENDIF
ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform