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

Declarative DataSources

Rotator bound to a XmlDataSource

  • Customer image
    Ana Trujillo
    Owner
    Ana Trujillo Emparedados y helados
  • Customer image
    Antonio Moreno
    Owner
    Antonio Moreno Taquería
  • Customer image
    Elizabeth Lincoln
    Accounting Manager
    Bottom-Dollar Markets
  • Customer image
    Patricio Simpson
    Sales Agent
    Cactus Comidas para llevar
  • Customer image
    Francisco Chang
    Marketing Manager
    Centro comercial Moctezuma
  • Customer image
    Roland Mendel
    Sales Manager
    Ernst Handel
  • Customer image
    Yoshi Tannamuri
    Marketing Assistant
    Laughing Bacchus Wine Cellars
  • Customer image
    Catherine Dewey
    Sales Agent
    Maison Dewey
  • Customer image
    Jean Fresnière
    Marketing Assistant
    Mère Paillarde
  • Customer image
    Yvonne Moncada
    Sales Agent
    Océano Atlántico Ltda.
  • Customer image
    Guillermo Fernández
    Sales Representative
    Pericles Comidas clásicas
  • Customer image
    Georg Pipps
    Sales Manager
    Piccolo und mehr
  • Customer image
    Sergio Gutiérrez
    Sales Representative
    Rancho grande
  • Customer image
    Jonas Bergulfsen
    Owner
    Santé Gourmet
  • Customer image
    Jytte Petersen
    Owner
    Simons bistro
  • Customer image
    Pascale Cartrain
    Accounting Manager
    Suprêmes délices
  • Customer image
    Miguel Angel Paolino
    Owner
    Tortuga Restaurante
  • Customer image
    Palle Ibsen
    Sales Manager
    Vaffeljernet
  • Customer image
    Accounting Manager
    Wartian Herkku
  • Customer image
    Matti Karttunen
    Owner/Marketing Assistant
    Wilman Kala
    

Rotator bound to a SqlDataSource

RadRotator supports binding to declarative data sources.

Table-based DataSource components can be used to bind the rotator declaratively at design time.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • Styles.css
  • RotatorDataSourceFile.xml
<%@ Page Language="vb" AutoEventWireup="true" Inherits="Telerik.Web.Examples.Rotator.DataBinding.ServerSideBinding.DeclarativeDataSources.DefaultVB"CodeFile="DefaultVB.aspx.vb"  %>

<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="Styles.css" rel="stylesheet" type="text/css" />
</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-thin">
        <h2>Rotator bound to a XmlDataSource</h2>
        <telerik:RadRotator RenderMode="Lightweight" ID="RadRotator1" runat="server" DataSourceID="XmlDataSource1"
                            Width="300px" ItemWidth="302px" Height="100px" ItemHeight="100px" ScrollDuration="2000"
                            FrameDuration="2000" RotatorType="AutomaticAdvance" CssClass="rotatorNoButtons"
                            BorderColor="#bfd8e8" BorderWidth="1">
            <ItemTemplate>
                <div class="itemTemplateNoButtons">
                    <asp:Image ID="CustomerImage" runat="server" AlternateText="Customer image" ImageUrl='<%# XPath("ImageUrl") %>'
                               CssClass="personImage"></asp:Image>
                    <div style="width: 200px; text-align: center; float: right;">
                        <div class="personName">
                            <asp:Label ID="PersonName" runat="server"><%# XPath("ContactName")%></asp:Label>
                        </div>
                        <div class="contactTitle">
                            <asp:Label ID="Label1" runat="server"><%# XPath("ContactTitle")%></asp:Label>
                        </div>
                        <div class="companyName">
                            <asp:Label ID="CompanyName" runat="server"><%# XPath("CompanyName")%></asp:Label>
                        </div>
                    </div>
                </div>
            </ItemTemplate>
        </telerik:RadRotator>
    </div>
    <div class="demo-container size-thin">
        <h2>Rotator bound to a SqlDataSource</h2>
        <telerik:RadRotator RenderMode="Lightweight" ID="RadRotator2" runat="server" DataSourceID="SqlDataSource1"
                            RotatorType="ButtonsOver" FrameDuration="300" Width="100px" ItemWidth="100px" Height="140px" ItemHeight="100px"
                            ScrollDirection="Up,Down" CssClass="rotatorWithButtons">
            <ItemTemplate>
                <asp:Image runat="server" ID="Image" ImageUrl='<%# Eval("CustomerID", "~/Img/Northwind/Customers/{0}.jpg") %>'
                           CssClass="personImage" AlternateText="Customer Image"></asp:Image>
            </ItemTemplate>
        </telerik:RadRotator>
    </div>
    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/Rotator/Examples/Data-Binding/Server-Side-Binding/Declarative-Data-Sources/RotatorDataSourceFile.xml">
    </asp:XmlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
                       SelectCommand="SELECT [CustomerID] FROM [Customers]"></asp:SqlDataSource>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance