If I fill a GridView with anonymous objects, how can i get their properties?

tbaran98

New Member
I have a GridView what I fill through a LINQ expression.
Something like this:\[code\]GridView1.DataSource = from c in customers, o in c.Orders, total = o.Total where total >= 2000 select new {id = c.CustomerID, order = o.OrderID, total = total};\[/code\]And in its RowCreated method I try to get a property, for example the id, but it has no a known type: \[code\]object element = e.Row.DataItem;int id = element.id; // It's bad!!!!!!\[/code\]How can I do?
Thanks!!
 
Back
Top