Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Click Event From Grid Header
Message
From
11/11/1998 10:02:10
 
 
To
10/11/1998 15:11:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00156309
Message ID:
00156576
Views:
53
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
Map
View

Click here to load this message in the networking platform