How To Databind LightBox ItemTemplate

2 posts, 0 answers
  1. Chad
    Chad avatar
    1 posts
    Member since:
    Nov 2013

    Posted 21 Nov 2013 Link to this post

    I have a lightbox setup with an ItemTemplate, I am displaying html text (not images like the data binding examples).  I have an 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?


  2. Kostadin
    Kostadin avatar
    1733 posts

    Posted 26 Nov 2013 Link to this post

    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."

    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.
Back to Top