|
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
|
|
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
|
|
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
|
|
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.
|
|
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?
|
|
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
|
|
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?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Unfortunately no. Our Grid row height is fixed. Sorry about that!
|
|