Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Column Control Source Conundrum
Message
 
 
À
27/03/2008 17:53:46
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:
01306336
Vues:
4
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.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform