If I have a simple XML file, like this:
<top>
<customer aaa="sss">
<name>Cust1</name>
<phone>123456789</phone>
<size>Large</size>
</customer>
<customer aaa="sss">
<name>Cust2</name>
<phone>987654321</phone>
<size>Small</size>
</customer>
</top>
And a RadGrid control like this...
<telerik:RadGrid ID="SearchResultsRadGrid" runat="server">
<MasterTableView
AutoGenerateColumns="true"
CommandItemDisplay="Top" >
<Columns>
</Columns>
</MasterTableView>
</telerik:RadGrid>
And I bind the XML to the Grid control via an XMLDataSource with this following code:
xmlDataSource.DataFile = @"C:\Development\TestArea\SimpleXML.xml";
xmlDataSource.XPath = "top/customer";
SearchResultsRadGrid.DataSource = xmlDataSource;
SearchResultsRadGrid.DataBind();
I would expect to see rows of name, phone, and size columns.
Instead I get this error: "Cannot find any bindable properties in an item from the datasource"
Rows and columns appear if I put attributes on the <customer> node, but this is not want is needed.
What am I missing to get the grid to display the data under the <customer> node?
Thanks