Missing Something Easy??

3 posts, 0 answers
  1. Ramjet
    Ramjet avatar
    51 posts
    Member since:
    Jul 2009

    Posted 16 Feb 2011 Link to this post

    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. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 18 Feb 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ramjet
    Ramjet avatar
    51 posts
    Member since:
    Jul 2009

    Posted 18 Feb 2011 Link to this post

    EXCELLENT! That also answers a question I had heading my way about scrolling.

    Thank You
    JB
Back to Top