I have a GridView which populates
ID Name City
1 Bobby AAA
2 Laura BBB
3 Ilisha CCC
I want to get an enumerable collection something like following
var Query= from p in GridView1.Rows
select new { User_ID=p.ID,User_Name=p.Name,User_City=p.City }.ToList();
How to get it?
Thanks in advance.
If you’re trying to use the actual object that the grid row represents, then you need to access the
DataItemproperty of the row.(
YourDatatypehere represents whatever type of object you’re expecting the grid to be bound to).