i am using RadImageGallery under RadWindow and bind it in codebehind
this is working fine but some time not working
<telerik:RadWindow ID="rdwnShowPicture" Behaviors="Close,Move,Reload" Modal="true"
ToolTip="Permit Detail" Width="800px" Height="600px" runat="server" VisibleStatusbar="False"
Title="Detail" ReloadOnShow="True">
<ContentTemplate>
<telerik:RadImageGallery RenderMode="Lightweight" ID="RdImgGalleryPic" runat="server" Width="100%" OnNeedDataSource="RdImgGalleryPic_NeedDataSource" DataImageField="imageUrl">
<ImageAreaSettings Height="455px" />
</telerik:RadImageGallery>
</ContentTemplate>
</telerik:RadWindow>
cs code
var imgData = (from sd in contextfct.StoreDocuments
where sd.Id == tId
select new { imageUrl = dv.LocationString, ContentType = dv.ContentType }).ToList();
DataTable dttable = new DataTable();
dttable.Columns.Add("imageUrl", typeof(string));
foreach (var it in imgData)
{
if (File.Exists(it.imageUrl))
{
byte[] bytes = File.ReadAllBytes(it.imageUrl);
string base64String = String.Format(@"data:" + it.ContentType + ";base64," + Convert.ToBase64String(bytes, 0, bytes.Length));
dttable.Rows.Add(base64String);
}
}
RdImgGalleryPic.DataSource = dttable;
RdImgGalleryPic.DataBind();
rdwnShowPicture.Title = "Picture";
rdwnShowPicture.ToolTip = "Picture";
string script = "function f(){$find(\"" + rdwnShowPicture.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);