Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Double-Click in Grid Textbox
Message
From
10/06/2010 12:52:42
 
 
To
10/06/2010 11:57:21
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01468179
Message ID:
01468334
Views:
41
>>>>Rich,
>>>>
>>>>You're running into grid's reconstruction problem (Vlad G has a good FAQ on this problem). When you programmatically assign recordsource to the grid, it looses all the code in its controls. There are many workarounds and the simplest is to use use SAFE Select approach.
>>>>
>>>I understand about safe selects. What I don't understand is how that is relevant to my problem.
>>>
>>>I put a grid on the form and create code for the dblclick event. If I can't use the form's init method to assign a recordsource to the grid, then where do I connect the grid and its data?
>>
>>I have not read the whole thread, so please forgive me if this is not an answer to your problem. The cursor which drives the grid should be created in the form's load event. Then it will already exist when the grid is created. If this empty cursor has the same structure as a table, the easiest is
>>Select * from yourtable where .f. into cursor somecursor readwrite
>
>The fastest is Create Cursor. The more complex the query, the better create cursor does, even with nodataonload or where 1=0.

I wrote easiest, not fastest. :-)
Previous
Reply
Map
View

Click here to load this message in the networking platform