我想用TileView展示产品,但当我给出url时,我不显示图片。我怎样才能克服这个问题?
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;
}发布于 2018-09-12 18:31:47
使用URI的简单答案是:
e.Item.Elements[6].ImageUri = new Uri(url);在您的情况下,问题可能是必须首先下载图像,以便控件使用它。所以你可能得先做这样的事
https://stackoverflow.com/a/3615831/1633308
然后,不再是您的URI作为web地址,而是本地图像文件(可能在临时存储中,您稍后会清理)。
https://stackoverflow.com/questions/52301074
复制相似问题