Bind LINQ Result to DataGrid

Seco

New Member
I have Linq results that I want to bind to a \[code\]DataGrid\[/code\], so I can edit the results. Please advise on what I am doing wrong. The following is my \[code\]C#\[/code\] code:\[code\] var root = XElement.Parse(xmlText); var elementsThatCanBeEmpty = new HashSet<XName> { XName.Get("Login"), XName.Get("CustomerStreet2"), XName.Get("PayeeStreet2"), XName.Get("PayAsName"), XName.Get("PayeeAccount") }; var transactionList = from transactions in root.Elements(XName.Get("Transactions")).Elements().AsEnumerable() where transactions.Elements().Any ( el => String.IsNullOrEmpty(el.Value) && !elementsThatCanBeEmpty.Contains(el.Name) ) select transactions; foreach (var t in transactionList) { Response.Write(t.Element(XName.Get("CustomerName")).Value); } dgBillPay.DataSource = transactionList; dgBillPay.DataBind();\[/code\]When I run the page, the DataGrid has headers of "\[code\]Value\[/code\], \[code\]Xml\[/code\], \[code\]HasAttributes\[/code\], \[code\]HasElements\[/code\], \[code\]IsEmpty\[/code\], \[code\]Value\[/code\], \[code\]BaseUri\[/code\]". What am I doing wrong here? Please advise.
 
Top