Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Jumpy grid cursor after header sort
Message
From
26/01/2000 22:17:15
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00323271
Message ID:
00323347
Views:
20
>my cursor seems to jump around in the grid after I have sorted my grid through clicking the header. Does anyone know how to keep my cursor from moving around? Help appreciated
>
>Thank You
>Nick Patel

When you change the order of a cursor and a grid has the focus, the top record in the grid is the one that is preserved. Add some code to your header class click that stores the current record number, and relocate on that record after you change the order. Here is the (simplified) code from my grid header class' click method:

THISFORM.LockScreen = .T.
lnSelect = SELECT()
SELE (THIS.Parent.Parent.RecordSource)
lnRecNo = RECNO()

IF LOWER(TAG()) <> THIS.SortTag
SET ORDER TO (THIS.SortTag)
ELSE
IF DESCENDING()
SET ORDER TO (THIS.SortTag) ASCENDING
ELSE
SET ORDER TO (THIS.SortTag) DESCENDING
ENDIF
ENDIF
SELECT (lnselect)
THIS.Parent.Parent.AfterRowColChange()
IF lnRecno > 0
LOCATE RECORD lnRecno
ENDIF
THIS.Parent.Parent.Refresh()
THISFORM.LockScreen = .F.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform