Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems Using A cursor to populate a grid in vfp5
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00387551
Message ID:
00387558
Views:
13
Kelly,

The problem is the grid.Init() fires before the form.Init(), so your cursor doesn't exist at the time the grid tries to bind to it.

The best solution is to move the SELECT statement to the Form.Load() which happens before all the Init()s. You could also use a View as the data source. Set the NoDataOnLoad property and then Requery( "theView" ) at form.Init() time.

>In the init of my form I have a sql-select that creates a cursor in which my grid has the record source set to the cursors name. When the form runs the grid does not load any of the data from the cursor even when I try to do a thisform.grid1.refresh().I found that if I set the recordsource to it self with this statement thisform.grid1.recordsource=thisform.grid1.recordsource it will load.
>I thought this was going to work, but I also want to setup some IIF statements in some of the column's controlsources. When I try to do this after I use the recordsource statement it doesn't work. The grid just shows 1 or row of data. Any help would be great I have till the 11th of this month to get this database working, and this grid is just driving me crazy. This is my first time doing anything in vfp, so im sort of learning as I go.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform