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

Having trouble displaying content

1 Answer 23 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Condorito
Top achievements
Rank 1
Condorito asked on 05 Oct 2011, 01:38 PM
I apologize in advance if maybe I'm just missing something obvious, but can't figure this out.  I have a rotator which I want to display only one item at a time, but it seems that when it slides to the next item, it is not lined up correctly and sometimes displays the content of two items at once.  I've attached an image as an example, and the code is below.  How can I make sure it only displays one item, similar to the rotator under the Twitter demo of the Notification control?  Thank you in advance.

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
      </telerik:RadScriptManager>
    
   <telerik:RadRotator ID="AlertsRotator" runat="server" RotatorType="Buttons" Height="200px" ItemHeight="200px" ScrollDirection="Left"
              Width="500px"  ItemWidth="500px">
            <ItemTemplate  >
             
            <div style="text-align: left">
                   <table width="480px">
              <tr>
                  <td align="Center"><strong><%# DataBinder.Eval(Container.DataItem," UserNotificationSubject") %></strong></td>
              </tr>
              <tr>
                  <td align="left"><%# DataBinder.Eval(Container.DataItem,"UserNotificationMessage") %></td>
              </tr>
              <tr>
                  <td>
                  <input type="button" value="click me" onclick="alert('<%# DataBinder.Eval(Container.DataItem,"UserNotificationSeqNum") %>')" /></td>
              </tr>
            </table>
                </div>
         
            </ItemTemplate>
          </telerik:RadRotator>
Public Partial Class Rotator
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim oData As New DataTable
        With oData
            .Columns.Add("UserNotificationSubject")
            .Columns.Add("UserNotificationMessage")
            .Columns.Add("UserNotificationSeqNum")
        End With
 
        Dim NewRow As DataRow = oData.NewRow
        NewRow("UserNotificationSeqNum") = "0"
        NewRow("UserNotificationSubject") = "Test User Notification Subject"
        NewRow("UserNotificationMessage") = "Test User Notifcation Message"
        oData.Rows.Add(NewRow)
 
        NewRow = oData.NewRow
        NewRow("UserNotificationSeqNum") = "1"
        NewRow("UserNotificationSubject") = "REMINDER"
        NewRow("UserNotificationMessage") = "Document T1 Reminder: I'm testing the reminders (To cancel this reminder use 20 on Document)"
        oData.Rows.Add(NewRow)
 
        NewRow = oData.NewRow
        NewRow("UserNotificationSeqNum") = "2"
        NewRow("UserNotificationSubject") = "REMINDER"
        NewRow("UserNotificationMessage") = "Document T1 Reminder: I'm testing the reminders adslfjkasd;lfja;ld jf;ladjf; lakjfd;askf jal;sdjf ;lasdjf;askjf;lka"
        oData.Rows.Add(NewRow)
 
        NewRow = oData.NewRow
        NewRow("UserNotificationSeqNum") = "3"
        NewRow("UserNotificationSubject") = "Web Entry Stuff"
        NewRow("UserNotificationMessage") = "The following document has been entered through the UI"
        oData.Rows.Add(NewRow)
 
 
        AlertsRotator.DataSource = oData
        AlertsRotator.DataBind()
    End Sub
 
End Class

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 10 Oct 2011, 09:42 AM
Hi Juan,

The problem is caused by the value, set in the Width property of the RadRotator. Please keep in mind that you should add 20 pixels to the width of the rotator control for every directional button, when using RotatorType Buttons. You can refer to the help article How to configure RadRotator, which contains information on the matter at the end.

In conclusion, the correct configuration of your RadRotator is displayed in the following example:
<telerik:RadRotator ID="AlertsRotator" runat="server" RotatorType="Buttons" Height="200px"
    ItemHeight="200px" ScrollDirection="Left" Width="520px" ItemWidth="500px">
    <ItemTemplate>
        ...
    </ItemTemplate>
</telerik:RadRotator>


Greetings,
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
Tags
Rotator
Asked by
Condorito
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or