Welcome Guest Search | Active Topics | Sign In | Register

Add an image inside grid cell Options
KarL
Posted: Friday, January 16, 2009 9:51:40 AM
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.




KarL
Posted: Friday, January 16, 2009 10:20:29 AM
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.
eo_support
Posted: Saturday, January 17, 2009 1:54:52 PM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.