Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
On making records Read Only
Message
 
 
À
22/12/1999 15:57:53
David Abraham
David Abraham & Associates, Inc.
New York City, New York, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00307542
Message ID:
00307557
Vues:
46
>Hi again guys and girls,
>
>I have spent a few moments (well, maybe longer) trying to figure out the best / most user-friendly / least tedious-to-code way to make a RECORD (not table, not field) (in a grid most, but not all, of the time) ReadOnly. Without thinking too hard, I can imagine a half-dozen techniques to do same. But I would like to know if there is some sort of standard VFP way to do this.
>
>Among the ways I can imagine are:
>fields' WHEN property: RETURN IIF(condexpr,.T.,.F.)
>intercepting a SAVE based upon the condexpr
>interactiveRowColChange: THIS.ReadOnly = IIF(condexpr,.T.,.F.)
>etc.
>
>But they don't feel right to me. I want something that works at the record level and is obvious code when you see it.

In a grid, I use code in the AfterRowColChange. You can base the condition on whatever you want. Also you do not need and IIF() if the expression evaluates to logical:

This.ReadOnly = CondExpr && OK if CondExpr evaluates to a logical value
This.ReadOnly = (ThisForm.optionGroup.Value = 1) && also OK

I can not really give you a definitive answer because there are so many possibilities available to you for just about any situation you can come up with.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform