How to use the ImageUrl property?

449 views Asked by At

I want to show products using TileView, but I do not show pictures when I give url. How can I overcome this problem?

private void tileView1_ItemCustomize(object sender, DevExpress.XtraGrid.Views.Tile.TileViewItemCustomizeEventArgs e)
{
    TileView view = sender as TileView;
    string ID = view.GetRowCellValue(e.RowHandle, "ID").ToString();.ToString();
    string url = "http://webpage.com/images/"+ ID + ".jpg";
    e.Item.Elements[6].ImageUri = url;
}
1

There are 1 answers

0
DonBoitnott On BEST ANSWER

The simple answer to using URI is this:

e.Item.Elements[6].ImageUri = new Uri(url);

The problem in your case might be that the image must first be downloaded in order for the control to use it. So you're probably going to have to do something like this first:

https://stackoverflow.com/a/3615831/1633308

and then, instead of your URI being the web address, it would be the local image file (probably in temporary storage that you clean up later).