Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid order
Message
From
10/05/2016 11:47:58
 
 
To
10/05/2016 10:06:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01636103
Message ID:
01636113
Views:
63
>Lutz - MS is quite happy to have code in the grid header click event - https://msdn.microsoft.com/en-us/library/azc9x3f9%28v=vs.80%29.aspx, so I put code in there just to see if it works, and it does, but you have to physically click it.
>
>I tried making a method called 'gridorder' and putting the 'set order to' in there, and calling that, but that didn't work either.

Even if MS is happy, it's really not a good idea. If for instance you add code in an event, and you want to call that code from some other part of your project, that event will fire. The side effects can be unpredictable. So the rule that events call methods, is a good one. But of course it's your choice. To be honest, I used to have code in events earlier, but changed my mind after some really bad experiences including hours of head scratching. :-)

To your actual problem, make sure that your "Set order to " command line contains something like "in (This.recordsource)".
Previous
Reply
Map
View

Click here to load this message in the networking platform