New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Programmatic Binding

Main Image

Item 1 of 0
 
This demo illustrates how easy it is to populate the RadImageGallery control using client-side logic. For that purpose one must create an ImageGalleryItem and add it to the ImageGalleryItemCollection. Below you can find a list of properties that could be set when a new instance of Telerik.Web.UI.ImageGalleryItem is created:
  • Owner
  • Width
  • Height
  • Title
  • Description
  • ImageUrl
  • ThumbnailUrl
  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • images.js
<%@ Page Language="vb" AutoEventWireup="false" Inherits="Telerik.ImageGalleryExamples.DataBinding.ClientSide.DefaultVB"CodeFile="DefaultVB.aspx.vb"  %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script src="images.js" type="text/javascript"></script>
    <script type="text/javascript">
        //<![CDATA[
        function pageLoad() {
            var imageGalleryItems = $find('<%=RadImageGallery1.ClientID%>').get_items();
            for (var i = 0; i < 11; i++) {
                var item = new Telerik.Web.UI.ImageGalleryItem({
                    title: images[i].title,
                    description: images[i].description,
                    thumbnailUrl: images[i].thumbnailUrl,
                    imageUrl: images[i].imageUrl
                });
                imageGalleryItems.add(item);
            }
        }
        //]]>
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <div class="demo-container size-wide">
        <telerik:RadImageGallery RenderMode="Lightweight" ID="RadImageGallery1" Height="600px" Width="800px" runat="server">
        </telerik:RadImageGallery>
    </div>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance