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

Simple RadRotator example

8 Answers 285 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Pontus Johansson
Top achievements
Rank 1
Pontus Johansson asked on 26 Aug 2010, 06:12 PM
I'm looking at the demo example of the radrotator and I can't get it to work. What I want is to scroll between two or more image that I know the urls of.

My code:

<telerik:RadRotator ID="RadRotator1" runat="server" Width="580px" ItemWidth="300"
                Height="250px" ItemHeight="220" ScrollDuration="500" FrameDuration="2000"
                PauseOnMouseOver="false">              
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl="http:/..1.jpg." />
                </ItemTemplate>
<ItemTemplate>
                    <asp:Image ID="Image2" runat="server" ImageUrl="http:/..2.jpg" />
                </ItemTemplate>
    </telerik:RadRotator>



What am I missing here? Nothing is visible.
        

8 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 27 Aug 2010, 09:15 AM
Hello,


Add the Image controls in RadRotatorItem -> ItemTemplate section and see whether it helps.

ASPX:
<telerik:RadRotator ID="RadRotator1" runat="server" Width="580px" ItemWidth="300"
    Height="250px" ItemHeight="220" ScrollDuration="500" FrameDuration="2000" PauseOnMouseOver="false">
    <Items>
        <telerik:RadRotatorItem>
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Basketball1.png" />
            </ItemTemplate>
        </telerik:RadRotatorItem>
        <telerik:RadRotatorItem>
            <ItemTemplate>
                <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Basketball2.png" />
            </ItemTemplate>
        </telerik:RadRotatorItem>
    </Items>
</telerik:RadRotator>



-Shinu.
0
Pontus Johansson
Top achievements
Rank 1
answered on 27 Aug 2010, 09:55 AM
Thank you!
0
Ugan
Top achievements
Rank 1
answered on 27 Apr 2011, 07:46 AM
Hi Shinu

I have tried the following modification to your code but it does not display anything - any ideas why? Code is below that doesnt display anything

<head id="Head1" runat="server">
    <title></title>
    <link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body class="BODY">
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
          
        <telerik:RadRotator ID="RadRotator1" runat="server" DataSourceID="SqlDataSource1" RotatorType="AutomaticAdvance">
     
    <Items>
      
        <telerik:RadRotatorItem>
      
            <ItemTemplate>
     
                 <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("fld_binaryfield2") %>'
                                AutoAdjustImageControlSize="true" Width="90px" Height="110px"  />
     
           </ItemTemplate>
     
        </telerik:RadRotatorItem>
  
  
        <telerik:RadRotatorItem>
     
            <ItemTemplate>
     
                  <telerik:RadBinaryImage runat="server" ID="RadBinaryImage2" DataValue='<%#Eval("fld_binaryfield1") %>'
                               AutoAdjustImageControlSize="true" Width="90px" Height="110px"  />
     
            </ItemTemplate>
     
        </telerik:RadRotatorItem>
      
    </Items>
  
</telerik:RadRotator>
  
 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings: %>"
ProviderName="<%$ ConnectionStrings.ProviderName %>" SelectCommand="SELECT COMMAND"
</asp:SqlDataSource
    </div>
    </form>
</body>
</html>
0
Niko
Telerik team
answered on 29 Apr 2011, 03:31 PM
Hi Ugan,

Please, make sure that you have specified all the dimensions in the declaration of the RadRotator, i.e. Width/Height and ItemWidth/ItemHeight.

Hope this helps.

Regards,
Niko
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Qurat
Top achievements
Rank 1
answered on 26 Apr 2013, 12:11 PM
Hi,
i want to clear images from radrotator once a new value is selected from radcombobox.
i am using radrotator and radcombobox.the district name is selected from radcombobox and its correponding images are displayed.
there is just one problem that all the districts don't have same number of images to be displayed.the district with less pictures shows blank segments for pictures meaning that once images are created they are not being cleared.
i am attaching my code kindly have a look.
0
Slav
Telerik team
answered on 30 Apr 2013, 10:05 AM
Hello Qurat,

I have already provided suggestions about your problem in this forum thread.

Please use a separate thread for every scenario you want to report in the future so that the information is easier to track.

Regards,
Slav
the Telerik team
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 their blog feed now.
0
Preeti
Top achievements
Rank 1
answered on 21 Jan 2014, 07:09 AM
Hi shinu,


Can we add images of database to rad rotator or is there any control by which i make a attractive gallery of database images.
0
Shinu
Top achievements
Rank 2
answered on 21 Jan 2014, 09:14 AM
Hi Preeti,

Please have a look into the following code snippet to show the images from database in RadRotator.

ASPX:
<telerik:RadRotator runat="server" ID="itemsRotator" Height="128px" DataSourceID="SqlDataSource1">
    <ItemTemplate>
        <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" AutoAdjustImageControlSize="false"
            Width="200px" Height="130px" ResizeMode="Fit" ImageAlign="Middle" DataValue='<%#Eval("Img") %>' />
    </ItemTemplate>
</telerik:RadRotator>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"  ConnectionString="<%$ ConnectionStrings:Northwind_newConnectionString %>"
    SelectCommand="SELECT [Img] FROM [Images]"></asp:SqlDataSource>

Thanks,
Shinu.
Tags
Rotator
Asked by
Pontus Johansson
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Pontus Johansson
Top achievements
Rank 1
Ugan
Top achievements
Rank 1
Niko
Telerik team
Qurat
Top achievements
Rank 1
Slav
Telerik team
Preeti
Top achievements
Rank 1
Share this question
or