This is a migrated thread and some comments may be shown as answers.

How To Databind LightBox ItemTemplate

1 Answer 87 Views
LightBox
This is a migrated thread and some comments may be shown as answers.
Chad
Top achievements
Rank 1
Chad asked on 22 Nov 2013, 02:32 AM

I have a lightbox setup with an ItemTemplate, I am displaying html text (not images like the data binding examples).  I have an asp.net label inside my ItemTemplate that I want to bind the lightbox control to a list of strings and show the string inside of the label.  I tried <%# Eval("mypropname")%> inside of the label but get a "Value of type 'System.Web.UI.Control' cannot be converted to 'Telerik.Web.UI.RadLightBoxItem'.


All of the Data* properties exposed server side appear to be specific to displaying images in lightbox.  Is there a way to databind a lightbox with a custom item template to a list of strings?  If not, is there a way to manually add these items to the lightbox server side?



Thanks!



1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 26 Nov 2013, 12:52 PM
Hi Chad,

I have already answered your support ticket and I will quoted my answer here if anybody else have a similar requirement.

"The only possible solution is to add the template programmatically into your code behind. For this purpose you have to create a class which inherits ITemplate interface. For your convenience I prepared a small sample and attached it to this thread."

Regards,
Kostadin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
LightBox
Asked by
Chad
Top achievements
Rank 1
Answers by
Kostadin
Telerik team
Share this question
or