Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid
Message
 
To
04/11/1997 10:22:36
George Alexander
Qatar Armed Forces
Doha, Qatar
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: Grid
Miscellaneous
Thread ID:
00057926
Message ID:
00059163
Views:
33
>
>
My situation is the form is running. The
>user clicks the ADD button. In the click event of the ADD button I want to creat an updatable cursor with
>a previously known no. of blank records which the user will fill and then after validation I can Insert into the
>many table.
>

Alex,

Well after you create the cursor, in the same Add.Click event, you shoudl set the recordsource of your grid (Grid.Recordsource= )(1) the cursor you just created and refresh the grid.

You know how to create a cursor, do you not? See under Create SQL in help, it is essentially that same as creating a table, except that you create a cursor. Hope this makes sense.

An idiosyncracy of VFP will require that before you do (1), you set grid.Recordsource= ''. What is not totally clear to me is what your grid will look like if you do not supply a recordsource at form opening time, that might just be a cosmetic problem.

>Is this situation possible. BTW I didn.t understand the difference between having the grid source in the Load
>and Init event?

It is not really applicable to your situation. I like to present my users with an empty grid with all the columns and stuff set when the form opens. To do that (I think that) you need to set the recordsource of your grid to the alias of a table or a cursor.

Now by definition, the cursor does not exist at opening time, so there is no cursor to set the grid's recordsource (this is analogous to a select before browse in good old FPD) to.

If you set the recordsourde at design time (like I like to do), then must create the cursor before the grid is created, otherwise the form will not load at run time. Now all the components of a form (including grids) are created before the init method is executed, so it is too late create the cursor in form.init. And that is why, another VFP idiosyncracy, their is this method called from.load, that is executed before the init _and_ before any of the components of the form are created.

Again, hopes this makes sense.

Kind regards,

Marc

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform