Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Column Control Source Conundrum
Message
From
27/03/2008 18:28:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01306330
Message ID:
01306344
Views:
4
What happens is the grid shows the returned value for the 1st record in every record. Sortof like it ran the udf when the controlsource was defined only. Also, if I look at the actual control source, it is thisform.poform.mymethod('myvalue') which looks correct, but isn't since it's not working.


>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"
Previous
Reply
Map
View

Click here to load this message in the networking platform