Bind to XmlDataSource.Data failure

4 posts, 0 answers
  1. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 22 Jan 2010 Link to this post

    I'm using a web-service to pull data from a SharePoint list which is then cleaned up and bound to a Rotator. During debug I can see that the XML is clean, and when checking the rendered source I can see that there are the appropriate number of items generated. The dummy text 'Boo!' even rotates twice as expected. However, I cannot seem to bind to the underlying elements such as <%# XPath("title") %>.

    Generated XML (sw)
    <?xml version="1.0" encoding="utf-16"?> 
    <newsfeed xmlns=""
        <title>Some Text here.</title> 
        <author>Smith, Steve</author> 
        <created>2008-02-04 16:28:43</created> 
        <body>Some Text here.</body> 
        <title>Some Text here.</title> 
        <author>Doe, John</author> 
        <created>2010-01-21 14:10:10</created> 
        <body>Some Text here.</body> 

    Code behind
    // code to retrieve and transform webservice feed above here 
    XmlDataSource1.Data = sw.ToString(); 

        <asp:XmlDataSource ID="XmlDataSource1" runat="server"></asp:XmlDataSource> 
        <div id="webpane"
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
            <telerik:RadRotator ID="rr_TacNews" runat="server" ScrollDirection="Left" FrameDuration="10000" 
                Height="800px" Width="100%" ForeColor="White" DataSourceID="XmlDataSource1"
                    <div style="width: 576px; padding: 12px;"
                        <asp:Label ID="Label1" runat="server" Text='<%# XPath("title") %>'></asp:Label><br /> 
                        <asp:Label ID="Label2" runat="server" Text='<%# XPath("author") %>'></asp:Label><br /> 
                        <asp:Label ID="Label3" runat="server" Text='<%# XPath("created") %>'></asp:Label><br /> 
                        <asp:Label ID="Label4" runat="server" Text='<%# XPath("body") %>'></asp:Label> 

    Any ideas?

  2. Fiko
    Fiko avatar
    1406 posts

    Posted 27 Jan 2010 Link to this post

    Hi Art,

    You do not see the text because you set the ForeColor="White" property of the control. I suppose that you have a white background color as well and this is the reason why you do not see the text inside the RadRotator control. Could you please change the background color or set a different value to the ForeColor property of RadRotator and the problem will disappear.

    In addition, I recommend you to specify the ItemWidth and ItemHeight properties of the RadRotator control. Also, I recommend you to remove the namespace that is used in the XML document or apply one of these approaches in order to able to use the XmlDataSource control:

    Please do not hesitate to contact us if you have any additional questions.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 27 Jan 2010 Link to this post

    The ForeColor is white because the background color of the wrapping div is dark gray. As I mentioned, when i view the generated source, I see two items as expected, but none of the subtending data items bind.

    Generated Source
            <div id="rr_TacNews" class="RadRotator RadRotator_Default" style="color:White;height:800px;width:100%;"
        <!-- 2009.3.1208.35 --><div class="rrRelativeWrapper"
            <div class="rrClipRegion"
                <ul class="rrItemsList"
                    <li class="rrItem"><div id="rr_TacNews_i0"
                    <div style="width: 576px; padding: 12px;"
                        <span id="rr_TacNews_i0_Label1"></span><br /> 
                        <span id="rr_TacNews_i0_Label2"></span><br /> 
                        <span id="rr_TacNews_i0_Label3"></span><br /> 
                        <span id="rr_TacNews_i0_Label4"></span> 
                    </div></li><li class="rrItem"><div id="rr_TacNews_i1"
                    <div style="width: 576px; padding: 12px;"
                        <span id="rr_TacNews_i1_Label1"></span><br /> 
                        <span id="rr_TacNews_i1_Label2"></span><br /> 
                        <span id="rr_TacNews_i1_Label3"></span><br /> 
                        <span id="rr_TacNews_i1_Label4"></span> 
            </div><a class="rrButton rrButtonUp" href="javascript:void(0);">&nbsp;</a><a class="rrButton rrButtonLeft" href="javascript:void(0);">&nbsp;</a><a class="rrButton rrButtonRight" href="javascript:void(0);">&nbsp;</a><a class="rrButton rrButtonDown" href="javascript:void(0);">&nbsp;</a> 
        </div><input id="rr_TacNews_ClientState" name="rr_TacNews_ClientState" type="hidden" /> 

    I will attempt your other suggestions.
  4. Mike
    Mike avatar
    6 posts
    Member since:
    Jun 2009

    Posted 27 Jan 2010 Link to this post

    I would add this to your XmlDataSource tag on your aspx page: 






Back to Top