Issues with xmldatasource databind in listview

2 posts, 0 answers
  1. Shannnon
    Shannnon avatar
    31 posts
    Member since:
    Oct 2010

    Posted 21 Feb 2011 Link to this post

    I have a ListView bind to xmldatasource, but I cannot make it work as the online demo does, it keeps saying "

    DataBinding: 'System.Web.UI.WebControls.XmlDataSourceNodeDescriptor' does not contain a property with the name 'Street'.

    "..when I changed the syntax from  <%#Eval("Street")%> to <%#XPath("Address/Street")%>, it kinda works but only pull out data under the first child node, the rest never got databinded. The xml file is like below:
        <Street>1234 S 1st St. </Street>
        <City>LOS ANGELES</City>
     Here is my xmldatasource: 
    <asp:XmlDataSource ID="XmlDataSource1" runat="server" 
                DataFile="~/sample1.xml" XPath="data"></asp:XmlDataSource>

    Any suggestions?

    Thanks a lot!


  2. Iana Tsolova
    Iana Tsolova avatar
    3388 posts

    Posted 24 Feb 2011 Link to this post

    Hi Shannnon,

    Try modifying the xml file as below:

      <Address Id="1000" Street="1234 S 1st St." City="LOS ANGELES" />

    Kind regards,
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft R3 2016 release webinar banner
Back to Top