Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid refresh losing properties
Message
From
05/01/1999 19:18:34
 
 
To
05/01/1999 17:14:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00172946
Message ID:
00172976
Views:
28
>I have a problem when setting up the contents of a grid. I have a grid based on the contents of a cursor and all goes well until I try to re-order the records that are held in the cursor. When anything is done to the underlying grid, all information is totally lost, the grid goes blank and it just looks like a white square on the screen. The only way I have found to get things back the way they were is to add a method to the form that re-sets all the grids properties, column count, record source etc etc etc. This wouldnt be too bad but I am also losing any method code that is originally attatched to the grid. For example I have some code in the dblclick method of the grid column that opens up a sub-screen showing extra detail for the record that is double clicked on and there is no way to get this back into the grid when the underlying cursor is re-freshed.
>
>I must be missing something obvious here but cant for the life of me figure out why all grid settings get lost when you change the underlying datasource.
>
>Any ideas?????
>
>Ashley Cottle
>ABC Promotional Marketing
>AshleyC@cosworth.infotrade.co.uk

Anytime you reopen underlying cursor, you actually force VFP to rebuild grid from scratch. Therefore you have two ways to cure this problem:
1. Don't reopen the cursor, i.e. you create read-write cursor and base grid on it once (e.g. in grid.init event). Next time when you want to change cursor contents, you just use ZAP/DELETE/INSERT/APPEND and any other xbase commands (but not direct SELECT-SQL).
2. If you still want to reopen the cursor, then you should every time restore all grid settings.
Edward Pikman
Independent Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform