+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / ImageGallery Control

ImageGallery Control

2 posts, 0 answered
  1. Stephen
    Stephen avatar
    70 posts
    Registered:
    09 Jun 2009
    20 Jan 2010
    Link to this post
    I associate an image library with each event and on my 'ContentViewSingleItemView.ascx' control I added the following code to show an image gallery. Even though I set the mode of the control to Lightbox, it does not work. It opens a new window with the large image which I click each image. Can you tell what's wrong with my code? Thanks.

    On the top of all control:
    <cc1:MetaMaster ID="MetaMaster1" runat="server">    
        <Mappings>   
            <cc1:MetaMapping MetaKey="GalleryID" TargetControlId="ImageGallery" TargetProperty="FilterExpression" TargetPropertyStringFormat="ParentID = {0}" />   
        </Mappings>   
    </cc1:MetaMaster>

    <sfLib:ImageGallery id="ImageGallery" runat="server" GalleryTemplateMode="Lightbox" ItemsPerPage="100"></sfLib:ImageGallery>
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    20 Jan 2010
    Link to this post
    Hello Stephen,

    The lightbox mode cannot be set declaretively. You have to set it up programmatically.

    ImageGallery gallery = new ImageGallery();
    gallery.SelectedPresentationMode.ID = "Lightbox";
    gallery.GalleryTemplateMode = ImageGallery.GalleryViewMode.Lightbox;
    gallery.BehaviorMode = Telerik.Cms.Engine.WebControls.ContentView.BehaviorModes.Master;
    gallery.ItemListTemplateName = "Telerik.Libraries.Resources.ControlTemplates.Frontend.GalleryLightboxList.ascx";
    Controls.Add(gallery);


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered