Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid
Message
From
09/11/1997 14:03:35
George Alexander
Qatar Armed Forces
Doha, Qatar
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: Grid
Miscellaneous
Thread ID:
00057926
Message ID:
00059181
Views:
31
>>
>>
> 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


Hi, Marc.

Thank you very much for the pain you took to make me understand. Now I got what you mean by creating
cursor. I think I solved the problem. I have the grid recordsource defined and the grid is working fine. Only
thing I wanted was to have a temporary cursor as the record source so that the user can add new records
to the many table and I can do the field validation without causing any VFP trigger appearing from the blues.

What I did is to create an array and create the cursor from the array so that there is no reference to any
triggers and I am happy to do my own validation. May be I am quite circular in the process??

thanks a lot

alex
Previous
Reply
Map
View

Click here to load this message in the networking platform