Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image In A Grid
Message
 
 
To
21/09/1997 08:02:58
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00050957
Message ID:
00053385
Views:
24
>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
Map
View

Click here to load this message in the networking platform