Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic Enabling in Grid
Message
De
09/01/2000 16:35:39
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00315109
Message ID:
00315249
Vues:
23
>Hi there,
>
> I have a grid and want to allow the user to edit only specific records in it.
>
> Can I enable or disable rows dynamically in a similar way to how I can change their background colour by through the DynamicBackColor property?
>
>
>Any help would be greatly appreciated,
>
>Thanks,
>
>
>Mark

You can do both:
1) DynamicBackColor:
*** grid.init event
This.Setall('DynamicBackColor','IIF(myrecordsource.myfield=25,0,255)','Column')
This code will set black backcolor for all records (rows) in recordosurce where field 'myfield' equals to 25 (you can use your own value or use form property here).
2) 'Dynamic' enabling:
Add two controls to each column where you want to have this behavior: e.g. add two textboxes 'Text1' and 'Text2'. These textboxes will be identical except their Enabled property: Text1.Enabled=.T. and Text2.Enabled=.F. Now you use DynamicCurrentControl property:
*** grid.init event
This.Setall('DynamicCurrentControl',"IIF(myrecordsource.myfield=25,'Text1','Text2')",'Column')
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform