Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Edward,
I am having a slight problem with the index solution. If I click the header of a column to change the sorting order, it works fine the first time. When I change columns and select a different column header, it sorts using the original index and not the new column.
Below is my code:
Thanks Scott
**--Code Placed in each column header.
thisform.grid_sort(this.caption)
***** Grid_Sort Method **********
**--This sort is called from the grid header
**--cField parameter comes from the header caption
**--which is the actual name of the field
parameters cField
cAlias = thisform.grid1.recordsource
select (cAlias)
**--Remove the index tag so I can issue a
**--new index
delete tag ALL of sortindx
index on &cField tag sortindx
**--Sortorder property used to determine sort order
if thisform.sortorder = .f.
set order to sortindx ASCENDING
else
set order to sortindx DESC
endif
go top
thisform.sortorder = !thisform.sortorder
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement