Hello
We are working on adding images to a RadLighbox. The images are all related to a single service ticket, but each note has it's own images directory.
We are adding the images by looking through the images located and adding them.
foreach (FileInfo image in images)
{
lightBoxItem = new RadLightBoxItem();
lightBoxItem.ImageUrl = String.Format("{0}/{1}", pixPath, image.Name);
lightBoxItem.Title = image.Name;
RadLightBox1.Items.Add(lightBoxItem);
}
Now, in the databind of the notes grid, we have thumnails for each image. We wrap a hyperlink around each thumnail and wire it up to the image in the lightbox to be opened by a js call (i = the index of the image
HyperLink hlnkImage = new HyperLink();
hlnkImage.ID = "hlnkImage" + i.ToString();
hlnkImage.SkinID = "hlnkImage";
hlnkImage.ImageUrl = String.Format("{0}/Thumbnails/{1}", pixPath, image.Name);
hlnkImage.ToolTip = image.Name;
hlnkImage.Attributes.Add("onclick", String.Format("OpenRadLigthBox('{0}'); return false", i));
divImageContainer.Controls.Add(hlnkImage);
divInner.Controls.Add(divImageContainer);
divOuter.Controls.Add(divInner);
This all works as expected EXCEPT. If we click on the hyperlink that corresponds to the first image (index 0), the image opens in the lightbox, but when we try to page, it errors out and the lightbox is then frozen. If we open any other image first, all works well, even the first image after paging to it.
Here is the js error
0x800a138f - JavaScript runtime error: Unable to get property '_get_hasTemplate' of undefined or null reference
Lastly here is the declarative ligthbox in the ascx page
<telerik:RadLightBox ID="RadLightBox1" runat="server" Modal="true" AppendDataBoundItems="true" RenderMode="Lightweight" LoopItems="true">
<ClientSettings AllowKeyboardNavigation="true" NavigationMode="Button" ShowItemsCounter="false">
<AnimationSettings HideAnimation="Resize" NextAnimation="Resize" PrevAnimation="Resize" ShowAnimation="Resize" />
</ClientSettings>
</telerik:RadLightBox>
We are working on adding images to a RadLighbox. The images are all related to a single service ticket, but each note has it's own images directory.
We are adding the images by looking through the images located and adding them.
foreach (FileInfo image in images)
{
lightBoxItem = new RadLightBoxItem();
lightBoxItem.ImageUrl = String.Format("{0}/{1}", pixPath, image.Name);
lightBoxItem.Title = image.Name;
RadLightBox1.Items.Add(lightBoxItem);
}
Now, in the databind of the notes grid, we have thumnails for each image. We wrap a hyperlink around each thumnail and wire it up to the image in the lightbox to be opened by a js call (i = the index of the image
HyperLink hlnkImage = new HyperLink();
hlnkImage.ID = "hlnkImage" + i.ToString();
hlnkImage.SkinID = "hlnkImage";
hlnkImage.ImageUrl = String.Format("{0}/Thumbnails/{1}", pixPath, image.Name);
hlnkImage.ToolTip = image.Name;
hlnkImage.Attributes.Add("onclick", String.Format("OpenRadLigthBox('{0}'); return false", i));
divImageContainer.Controls.Add(hlnkImage);
divInner.Controls.Add(divImageContainer);
divOuter.Controls.Add(divInner);
This all works as expected EXCEPT. If we click on the hyperlink that corresponds to the first image (index 0), the image opens in the lightbox, but when we try to page, it errors out and the lightbox is then frozen. If we open any other image first, all works well, even the first image after paging to it.
Here is the js error
0x800a138f - JavaScript runtime error: Unable to get property '_get_hasTemplate' of undefined or null reference
Lastly here is the declarative ligthbox in the ascx page
<telerik:RadLightBox ID="RadLightBox1" runat="server" Modal="true" AppendDataBoundItems="true" RenderMode="Lightweight" LoopItems="true">
<ClientSettings AllowKeyboardNavigation="true" NavigationMode="Button" ShowItemsCounter="false">
<AnimationSettings HideAnimation="Resize" NextAnimation="Resize" PrevAnimation="Resize" ShowAnimation="Resize" />
</ClientSettings>
</telerik:RadLightBox>