Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SET VIEW TO filename is blanking out my grid
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00128144
Message ID:
00128280
Views:
26
Brenda,

You are doing alot of unnecessary work here. Here's some code that will take care of your grid (I still say you need to get rid of the view files).
* Grid save and restore
WITH THISFORM.Grid1
   LOCAL laCols(.ColumnCount), lnCnt, lcRecordSource
   FOR lnCnt = 1 TO .ColumnCount
      laCols(lnCnt) = .Columns(lnCnt).ContolSource
   ENDFOR
   lcRecordSource = .RecordSource
   .RecordSource = ""

   * Do your thing here

   .RecordSource = lcRecordSource
   FOR lnCnt = 1 TO .ColunmCount
      .Columns(lnCnt).ControlSource = laCols(lnCnt)
   ENDFOR
ENDWITH
You can greatly simplify everything for yourself by using views (that is real views in a database), private data sessions, and the other features of Visual Foxpro instead of using the features left over from FoxBASE +. You would spend less time learning those features than it will take to get this working the way you are doing now.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform