Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Image In A Grid
Message
 
À
21/09/1997 08:02:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00050957
Message ID:
00053385
Vues:
30
>I created a grid based on a table where I added an image control in one of the columns.
>How can I set the image control picture property depending on the value of a particular field?

There is a column property called DynamicCurrentControl. You need to create a control for *each* picture you wish to be displayed, then set the DynamicCurrentControl property to display the appropriate picture control. For example, create three picture controls: imgMyPic1, imgMyPic2, and imgMyPic3. All of these go into the column. Then, in the Init method of the grid, set the column's dynamic current control to select the appropriate image:

This.grcMyCol.DynamicCurrentControl = ' IIF(FieldVal = 1, "imgMyPic1", IIF(FieldVal = 2, "imgMyPic2", "imgMyPic3"))'

Hopefully you don't have too many different pictures to display! We're using this method successfully, and it the performance is more than acceptable. Good luck!
- della
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform