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

System.Web.UI.WebControls.XmlDataSoureNodeDescriptor does not contain a property with the name

1 Answer 53 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Johann
Top achievements
Rank 1
Johann asked on 11 Mar 2013, 10:32 AM
Hi

I have a simple RadAutoCompleteBox as follows :-

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server"
        DataTextField="Name" DataValueField="Id" DataSourceID="XmlDataSource1"
        />
 
<asp:XmlDataSource runat="server" ID="XmlDataSource1" DataFile="Persons.xml">
</asp:XmlDataSource>
 
</div>
</form>
and the XML File looks like this

<?xml version="1.0" encoding="utf-8"?>
<Persons>
  <Person>
    <Id>1</Id>
    <Name>Rita</Name>
    <Surname>Nelson</Surname>
    <Age>59</Age>
  </Person>
  <Person>
    <Id>2</Id>
    <Name>Simon</Name>
    <Surname>West</Surname>
    <Age>59</Age>
  </Person>
  <Person>
    <Id>3</Id>
    <Name>Richard</Name>
    <Surname>Mitchell</Surname>
    <Age>59</Age>
  </Person>
  <Person>
    <Id>4</Id>
    <Name>Alison</Name>
    <Surname>McGrath</Surname>
    <Age>59</Age>
  </Person>
</Persons>

However I am getting this error in a popup on keystroke

System.Web.UI.WebControls.XmlDataSoureNodeDescriptor does not contain a property with the name "Name"

What am I doing wrong?

Thanks for your help

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 12 Mar 2013, 11:54 AM
Hi Johann,

Your xml file has to have the following structure in order for the binding to work:
<?xml version="1.0" encoding="utf-8" ?>
<Persons>
  <Person Name="Rita" Id="1"></Person>
  <Person Name="Simon" Id="2"></Person>
  <Person Name="Richard" Id="3"></Person>
</Persons>

 

Kind regards,
Bozhidar
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
AutoCompleteBox
Asked by
Johann
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or