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

Missing Something Easy??

2 Answers 44 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Ramjet
Top achievements
Rank 1
Ramjet asked on 16 Feb 2011, 06:38 AM
Hello,

I have to be missing something very easy here. I have a radRotator that works when I reference the Telerik rss feed but fails when I reference a local XML file. I know it reads because putting a breakpoint catches it during the read and further view source show the output HTML with the values from the XML file for the list items so....What simple thing am I missing?

HTML Code:
<table id="tbl_Basics" cellpadding="0" cellspacing="0" border="0" width="220">
     <tr>
          <td>
               <a href='<%# XPath("EventLink").ToString()%>' style="cursor: pointer; text-decoration: none; color: Black; background-image: url('images/Mondaytest.png');"></a>
  
<telerik:RadRotator ID="rotatr_ChurchEvents" RotatorType="AutomaticAdvance" ScrollDirection="Up" ScrollDuration="4000" runat="server" Width="220" DataSourceID="XMLChurchEvents" ItemWidth="220" Height="330" ItemHeight="64" FrameDuration="1" InitialItemIndex="-1" CssClass="rotator">
                                <ItemTemplate>
                                    <div class="itemTemplate" onclick="document.location='<%# XPath("EventLink").ToString()%>'" style="background-image: url('images/Mondaytest.png');">
  
                                        <div class="dateTime">
                                            <div class="time">
                                                <%# (this.GetTimeOnly(XPath("EventTime").ToString())) %>
                                            </div>
                                              
                                            <div class="date">
                                                <%# XPath("EventDate").ToString() %>
                                            </div>
                                        </div>
  
                                        <div class="title">
                                            <span>
                                                <%# System.Web.HttpUtility.HtmlEncode(XPath("EventText").ToString())%>
                                            </span>
                                        </div>
  
                                    </div>
                                </ItemTemplate
                            </telerik:RadRotator>
                            <asp:XmlDataSource ID="XMLChurchEvents" runat="server" XPath="ChurchEvents/Events/EventDetails" DataFile="XML/ChurchEvents.xml" />
                        </td>
                    </tr>
                </table>

No code behind worth lokking at. Here is the XML doc structure:
<?xml version="1.0" encoding="utf-8" ?>
  <ChurchEvents>
    <Events>
        
      <!-- USE This Section for weekly events-->
      <EventDetails>
        <EventText>Worship Service</EventText>
        <EventTime>11:00</EventTime>
        <EventDate>Sunday</EventDate>
        <EventLink></EventLink>
      </EventDetails>
        
        
        
        
        
      <!-- Use this section for special events-->
      <EventDetails>
        <EventText>Financial Peace</EventText>
        <EventTime>02:00</EventTime>
        <EventDate>Sat. Feb. 27</EventDate>
        <EventLink></EventLink>
      </EventDetails>
        
        
    </Events>
  </ChurchEvents>

Thank You for your assistance
JB

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 18 Feb 2011, 03:56 PM

Hello JB,

There are a few behavior patterns of RadRotator:

  • If you do not have enough data (items) to populate the whole viewport of the RadRotator and the InitialItemIndex is set to "-1" the Rotator will not start scrolling and therefore will not show any of the data
  • If you do not have enough data (items) to populate the whole viewport of the RadRotator and the InitialItemIndex is not explicitly defined (defaults to "0") the Rotator will show the items but will not scroll

You could also try populating the XML file with fake items (i.e. copying the existing ones 2 or 3 times) and see if your project works properly as that is exactly what solved the issue on our side (plus an imitation of your this.GetTimeOnly() method that simply returns the string from XPath).



Regards,
Marin
the Telerik team
0
Ramjet
Top achievements
Rank 1
answered on 18 Feb 2011, 04:12 PM
EXCELLENT! That also answers a question I had heading my way about scrolling.

Thank You
JB
Tags
Rotator
Asked by
Ramjet
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Ramjet
Top achievements
Rank 1
Share this question
or