Welcome Guest Search | Active Topics | Sign In | Register

Image Preview in Grid Control Options
markw
Posted: Thursday, December 20, 2007 5:23:42 AM
Rank: Member
Groups: Member

Joined: 11/12/2007
Posts: 27
Hello,

I have a requirement that using the New Grid Control:-

One of the columns to be an image preview ie <img src=%> Where % is
dynamically set to a URL that is relevant for that row is this possible?

The Grid results are for a shopping cart that shows a preview of each item in the cart.

Thank you
Mark W
eo_support
Posted: Thursday, December 20, 2007 5:53:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi Mark,

Yes. It is possible. You would use a StaticColumn and then set the column's:

1. DataField to the field that contains the Url;
2. DataFormat set to <img src="{0}" />;

That should render the image in the static column for you.

Thanks
markw
Posted: Thursday, December 20, 2007 6:24:24 AM
Rank: Member
Groups: Member

Joined: 11/12/2007
Posts: 27
Okay that may work the only problem i have is the Img URL is a combination of 3 fields as:-

BASEURL/ClientCode/BasketNumber/ItemID.jpg

Can i return more than one field in DataField?

MarkW

eo_support
Posted: Thursday, December 20, 2007 6:40:56 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
No. You will need to format it before passing it to the Grid. If you use SQL, you can do something like "SELECT A + B as C" to create a field C whose value is derived from field A and B. If you bind to an array of objects, you can simply define an additional property that derives its value from other properties.

markw
Posted: Thursday, December 20, 2007 6:47:57 AM
Rank: Member
Groups: Member

Joined: 11/12/2007
Posts: 27
I have as described above put the datafield as ClientRef
Then then DataFormat as <img src="{0}" />;
in a static Column for some reason it still only shows the Field Value not as an image?
eo_support
Posted: Thursday, December 20, 2007 6:58:57 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

We have verified with the latest version and it works fine. So please upgrade to the latest and see if it works. If it still doesn't, please post your grid definition and we will then take a look.

Thanks
markw
Posted: Thursday, December 20, 2007 7:53:30 AM
Rank: Member
Groups: Member

Joined: 11/12/2007
Posts: 27
Thank you Very much the latest version does show the image now, one final thing to show the image correctly is
there a way for each grid row to be the height of the image as they are different sizes rather than a fixed row height?
eo_support
Posted: Thursday, December 20, 2007 8:00:39 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Unfortunately no. Our Grid row height is fixed. Sorry about that!


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.