Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another Grid Solution Needed?
Message
 
À
01/10/1998 02:13:13
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00142467
Message ID:
00142723
Vues:
44
>>>>Hi Everyone,
>>>>
>>>>How could I control a single row from a Grid? For Example, Set a particular row to be ReadOnly = .T. while other rows are ReadOnly = .F. if specific condition is setted.
>>>>
>>>>Any Help is Appreciated.
>>>>
>>>>Steve
>>>>
>>>>P.S. Want to thanks both Ken Weber and Edward Pikman for their help.
>>>-In afterrowcolchage you could check recno() and change grid.readonly. It wouldn't be a problem all is readonly or readwrite for it's important for current control.
>>>-Or you might take the long way and duplicate controls with readonly = .t. ones, place your expression in dynamiccurrentcontrol.
>>>-Loop via columns and change readonly state etc
>>>Cetin
>>
>>That would work, but it you wanted to have some columns on the row read and others read only you could put this in the afterrowcolchange:
>>
>>WITH THISFORM
>>FOR t = 1 to .grd1.columns()
>> .grd1.columns(m.t).readonly = IIF(???, .T., .F.)
>>ENDFOR
>>ENDWITH
>>
>>You could replace the IIF WITH a DO CASE for each m.t value, i.e. each column of the grid.
>Ken,
>Yes but it's in the "take the long way list". And you could even make it shorter :
thisform.grd1.setall("Readonly",lExpression,"Column")
BTW ??? is shorter notation for iif(???, .t., .f.).
>Cetin

Hey Cetin,

Yup, it is longer, but it provides the ability to turn only certain columns in the active row to read only...I realize that was not the original question, which was dealing with the entire row, but I have been confronted with the need in the past to turn select columns to read only...especially with 5.0a where the activatecell method didn't work...glad they fixed it in 6.0 :)
Ken Sorce
Team RAD, Inc.
Rapid Application Developers
Ken@TeamRAD.com
www.teamrad.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform