Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid properties changes after recreate the table ?
Message
From
22/09/2003 12:03:32
 
 
To
22/09/2003 11:47:38
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00831131
Message ID:
00831141
Views:
22
my grid's recordsource is a table i have created by code. when i recreate the table the grid appears with default properties of the grid. how can i correct it ?

You should not re-create the table. Instead, you should do what I call a "safe select". Basically, the idea is that you do a SELECT into a CURSOR, ZAP the grid's RecordSource, and then APPEND FROM DBF( 'MyCursor' ). Code similar to this (if you add a custom method to your grid class called ResetGrid):
SELECT ( This.RecordSource )
ZAP
SELECT Yada, Nada, Blah FROM SomeTable WHERE SomeCondition INTO CURSOR csrJunk NOFILTER
SELECT ( This.RecordSource )
APPEND FROM DBF( 'csrJunk' )
USE IN csrJunk 
GO TOP IN ( This.RecordSource )
This.Refresh()
Another alternative is to use a parameterized view for the grid's RecordSource and REQUERY it with the new parameter when you have to change the data in the grid.
Previous
Reply
Map
View

Click here to load this message in the networking platform