>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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only