Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set Grid Record Order on the fly
Message
 
 
À
15/07/2009 04:47:53
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:
01412595
Vues:
53
Hi Marcia,

How do you determine cSortField?

I just found a bug in my own class - I was getting the field /cursor based on the column's controlsource. For complex expressions this doesn't work.

> 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
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform