Dynamic Images

Received : 2007/09/28 10:44:28
Message : I would like to find out how it is possible to add Bitmap and Jpeg images to the Web Grid when Image URL links are returned from the dataset obtained via a stored procedure


This message was posted using Aspose.Live 2 Forum

Hi,

Well you may insert images as hyperlinks to the gridweb control matrix. Get the URLs from the dataset / datatable and set them to Hyperlink.ImageUrl property. You may store the urls into string [] array and set them as Image Url(s).

Following is some simple code which works fine.

//Adds a image hyperlink.
Hyperlink linkOfImage2 = GridWeb1.WebWorksheets[0].Hyperlinks.AddHyperlink("B7");
//Get the web image from URL.
linkOfImage2.ImageUrl = "http://files.myopera.com/Mickeyjoe_irl/albums/38458/nissan%20cube%20in%20car%20park.jpg";
//OR get it from some inner folder in the web project.
//linkOfImage2.ImageUrl = "../style/Aspose.Grid.gif";
.
.
.
Thank you.

Is there anything I can do to add Image Hyperlink as column property versus looping through every cell in the column to add the hyperlink to an each cell in the column?

Hi,

Well, I think you have to loop through the cells to set their image urls. We will check and may consider it soon.

Thank you.