Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Column Control Source Conundrum
Message
De
27/03/2008 18:23:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01306330
Message ID:
01306341
Vues:
5
Yeah, I had tried:

lcfunction = toform.myarray[i,1]
.controlsource = EVAL(lcfunction)

which I would think would do the same thing, but I'll try it your way just in case...


>Maybe
>
>.controlsource = EVAL(toForm.myarray[i,1])
>
>>Normally when I want to set a grid column controlsource to run a form method, I will do something like this:
>>
>>grid1.column1.controlsource = [thisform.mymethod('myvalue')]
>>
>>and it works fine. However, I need to pass that to a another form to set the control source for it's grid to the same method in the 1st form (calling form). I build a form array to store the value for all the columns' controlsource, then I look at that array in the called form:
>>
>>In form 1 (calling form):
>>
>>thisform.myarray(1,1) = "[thisform.poform.mymethod('myvalue')]"
>>
>>In form 2 (called form):
>>
>>LPARAMATERS toForm && form called by which contains the array and the method
>>THISFORM.poForm = toForm
>>*--An example but shows what I'm doing
>>FOR i = 1 TO ALEN(toform.myarray,1)
>>   WITH THISFORM.grid1.Columns[i]
>>      lcType = TYPE(toform.myarray[i,1])
>>      do case
>>      case lcType = "C" && this works, even with the UDF
>>        .width = && a computation that works
>>      endcase
>>      .controlsource = toForm.myarray[i,1] && normally this is just a field name
>>      * for the udf toForm.myarray[i,1] = "[thisform.poform.mymethod('myvalue')]" without quotes
>>      * so it does not work for udfs, it ends up the character string thisform.poform.mymethod('myvalue')
>>      * when the udf call is in a variable, how to set it here?
>>   ENDWITH
>>ENDFOR
>>
>>
>>
>>I've tried a dozen or more variations of storing the value in the array in the 1st form and checking it in the 2nd form.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform