Hello,
I'm having some problems in using DataGrid with LINQ.
The following code makes crashing the IE7.
XDocument xmlProducts = XDocument.Parse(xmlContent);
var products = from product in xmlProducts.Descendants("Product")
select new
{
ProductID = Convert.ToInt32(product.Element("ProductId").Value),
ProductName = (string)product.Element("ProductName").Value
};
datagrid1.ItemsSource = products;
Env:
1) Vista Home Premium (32)
2) VS 2008 + SL2 (beta1)
3) IE7
Let me know if you need more details.
Note:
If you are using class and List<T> like the example from doc, it's working fine. but why not work with LINQ and implicitly-typed variable?
(If this has answered your question, please click on "Mark as Answer" on this post. Thank you!)
Best Regards,
Michael Sync
Microsoft WPF & Silverlight Insider
Blog : http://michaelsync.net