Rank: Member Groups: Member
Joined: 11/20/2008 Posts: 14
|
Hi,
Im triying to do the follow to add an image inside a grid cell but It doesn´t work.
"You can use a StaticColumn and set the column's DataFormat to something like "<img src='{0}' />". If your data source contains the image url, the url will be filled into that format string and you will have an image tag in your cell."
I put it just like in the example but the cells just show "". instead of the image. Please can you help me.
Thank a lot.
|
Rank: Member Groups: Member
Joined: 11/20/2008 Posts: 14
|
Hi,
Please could someone help me with this topic. I've tried everything that comes to my mind.
Thanks for any help.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The key is you need to set both DataFormat and DataField property. At runtime, the Grid gets the data from DataField first, then formats it using DataFormat. As a test, you can try to get the Grid to display the data as is (displaying raw Url) without DataFormat first, then use DataFormat to change it to an image element.
Thanks!
|