我的代码是:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="XmlDataSource1"
CellSpacing="0" DataMember="TITLE" GridLines="None">
<MasterTableView DataMember="TITLE" DataSourceID="XmlDataSource1">
<CommandItemSettings ExportToPdfText="Export to PDF" />
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column">
</EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites="False">
</FilterMenu>
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
</HeaderContextMenu>
</telerik:RadGrid>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/Bin/xml.xml" EnableCaching="false">
</asp:XmlDataSource>
当我调试它时,它说“无法在数据源中的项目中找到任何可绑定属性 ..我该怎么办?请帮助:/
答案 0 :(得分:1)
对我来说,使用对象数据源,我们可以给对象ds一个xml源代码,但对于你的情况,这里有一些有用的链接: http://forums.asp.net/t/1409700.aspx
http://dotnetslackers.com/Community/blogs/bmains/archive/2006/06/25/87.aspx
http://www.beansoftware.com/ASP.NET-Tutorials/XMLDataSource-Control.aspx
http://www.developer.com/net/asp/article.php/3553881/Binding-to-XML-Data-in-ASPNET-20.htm
这是最好的一个:
http://decoding.wordpress.com/2008/12/22/aspnet-how-to-use-an-xmldatasource-with-a-gridview/ 如果有帮助则标记为已回答:)