Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best places to save and restore grid column pos/width
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01368984
Message ID:
01368994
Views:
14
>Hi all
>
>What are the best places to save and restore the positions of a grid's columns. I can successfully restore the saved properties in Grid.Init() but have to save the grid column properties in the Form.Release() which beats the OOP purpose. Grid.Destroy() for saving is too late as there are no longer any columns.
>
>Please advise.

My legs are an integral part of my body. Think of the grid as an integral part of that form. Get/set its properties in the form's release() method (or my favorite: QueryUnload) and don't bother about it too much. At the time you remove or rename the grid or one its columns and run the form, you'll be warned by an error message and need only change some code in the release method.

I know that OOP gurus want us to do it differently, but I'm not a purist.

Note: QueryUnload is my favorite place for calling the method that saves coordinates, but it must be admitted that it's part of my shutdown system that also releases forms that were invoked by objects on the form. And I cannot use thisform.release(), unless that method calls QueryUnload explicitly.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform