>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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement