General information
Category:
Forms & Form designer
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only