>>>Hi all,
>>>I have a problem with =EVALUATE()
>>>I have a form with one grid in it.
>>>I put below code in a method ( SetGridEnabled ) and run it where i want.
>>>
>>>
>>>FOR nCounter = 1 TO 4
>>> = EVALUATE("thisform.grid1.column"+ALLTRIM(STR(nCounter))+".Enabled = .F.")
>>> = EVALUATE("thisform.grid1.column"+ALLTRIM(STR(nCounter))+".text1.Enabled = .F.")
>>>ENDFOR
>>>
>>>
>>>but it is not worked.
>>>if i use this as below
>>>
>>>
>>>thisform.grid1.column1.Enabled = .F.
>>>* other column
>>>
>>>
>>>it worked.
>>>WHY?
>>
>>EVAL() evaluate a expression, set a property is a command.
>>
>>When you set column's enabled, VFP copy the value into the column's control ( text )
>>
>>But you can use columns collection:
>>
>>with thisform.grid1
>> FOR nCounter = 1 TO 4
>> .columns[m.nCounter].Enabled = .F.
>> ENDFOR
>>endwith
>>* for all columns you can set
>>thisform.grid1.Enabled = .F.
>>
>
>Dear Fabio,
>if i use from
>
>thisform.grid1.Enabled = .F.
>
>
>user can not scroll in grid. i want my user can scroll but can not edit values.
Hi Reza,
Then use
Readonly instead
Enabledthisform.grid1.Readonly = .t.
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst