Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Grid Record Order on the fly
Message
From
15/07/2009 04:47:53
 
 
To
14/07/2009 16:48:58
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01412342
Message ID:
01412444
Views:
79
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform