Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Double-Click in Grid Textbox
Message
De
09/06/2010 20:08:18
Luis Navas
Independent Consultant
Auckland, Nouvelle Zélande
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
01468179
Message ID:
01468199
Vues:
59
Really I thought you will only loose Formatting not code, are you sure Naomi?

>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.
>
>http://weblogs.foxite.com/andykramek/archive/2005/03/19/174.aspx
>
>
>
>>>>>Do you have the property AllowCellSelection to False?
>>>Huh?
>>
>>I had interpreted this to mean that ths value SHOULD be false.
>>
>>>MyGrid.AllowCellSelection = .T. (so that your textbox's dblclick event will fire instead of the grid's dblclick)... then put your code back in the textbox's dblclick event.
>>>
>>>You could use bindevents, or the grid's events, but I think you're gonna want to stay really basic here until you get your bearings.
>>ABSOLUTELY
>>
>>
>>*Form Init Method
>>CLOSE DATABASES all
>>USE myTable
>>SET PROCEDURE TO myProcFile
>>DO create_heirarchy WITH "myTable","task","Parent","crsFormatted"
>>GO TOP
>>WITH thisform.grid1 
>>	.recordsource = "crsFormatted"
>>	.ColumnCount = FCOUNT('crsFormatted')
>>ENDWITH
>>
>>------------------------------------------------------------------------------
>>*Form1.grid1.column1.text1.dblclick
>>MESSAGEBOX("Column1 Double Click")
>>
>>*Form1.grid1.column2.text1.dblclick
>>MESSAGEBOX("Column2 Double Click")
>>
>>*Form1.grid1.column3.text1.dblclick
>>MESSAGEBOX("Column3 Double Click")
>>
>>*Form1.grid1.column4.text1.dblclick
>>MESSAGEBOX("Column4 Double Click")
>>
>>*Form1.grid1.column5.text1.dblclick
>>MESSAGEBOX("Column5 Double Click")
>>
>>
>>that's all the code in the form. The form is your basic VFP CREATE FORM. The grid is your basic VFP class (class = grid, baseclass = grid). Double-click in any column of the grid and the cell's contents get highlighted exactly as if there were no dbl-click code in the textbox.
>>
>>What's even more perplexing to me is that we have grid classes that can be sorted and filtered. I put one of those on my form and put MESSAGEBOX() and NODEFAULT in the grid textbox controls and got the same non-result. But making it as basic as possible doesn't seem to help
>>
>>Thanks for your help. When it gets solved it will probably be a DUH moment.
I never forget a face, but in your case I will make an exception :-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform