Binding datagrid to XML

Mar 23, 2009 at 10:07 PM
How can I bind the WPF datagrid to XML?  I followed Bea Stollnitz's great blog article on binding to XML in WPF but when I add in a DataGrid and bind to the XmlDataProvider, I get an error that ItemsSource cannot be an XmlDataProvider.  As Bea's blog article demonstrates, ListBox ItemsSource can be an XmlDataProvider so what about DataGrid?  How can I do this?

I did use ItemsSource="{Binding}" but that only made my grid bind to the XML document object model rather than to the XML data in the document.

Regards,

Dale
Coordinator
Mar 27, 2009 at 12:45 PM
See this thread, http://www.codeplex.com/wpf/Thread/View.aspx?ThreadId=39322.