Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automatically resorting grid while entering data?
Message
From
08/03/2000 04:14:37
 
 
To
07/03/2000 17:42:09
Peter Brama
West Pointe Enterprises
Detroit, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00342964
Message ID:
00343160
Views:
27
Hi Peter.

>> That works when you change row but not column.... <<

This code in the LostFocus() of the TextBox in the grid column that is bound to the date field. Then, if the user changes the date, when they tab off of the cell, the grid will re-sort itself:


LOCAL lnrecno
*** If the grid's RecordSource has an index tag on this field
*** We want make sure that as soon as we change its contents,
*** The grid displays everything in the correct order
*** First Check to see if we have changed this field
IF INLIST( GETFLDSTATE( JUSTEXT( This.ControlSource ), This.Parent.Parent.RecordSource ), 2, 4 )
Thisform.LockScreen = .T.
WITH This.Parent.Parent
lnRecno = RECNO( .RecordSource )
*** Scroll Up one Page
GO TOP IN ( .RecordSource )
.DoScroll(2)
*** Scroll back down one page
GO BOTTOM IN ( .RecordSource )
.DoScroll(3)
*** Finally, go back to the original record
GO lnRecno IN ( .RecordSource )
ENDWITH
Thisform.LockScreen = .F.
ENDIF

Marcia
Previous
Reply
Map
View

Click here to load this message in the networking platform