Please note that this blog is only applicable for ASP.NET GridView and in case you are using a Grid froma Third Party source then there might be a different approach to do the same.
We have been using the below code to bind a GridView:
- DataTable dt = new DataTable();
- GridView1.DataSource =dt;
- GridView1.DataBind();
Now, in order to get the data from the already binded GridView, we can use the below code:
- DataTable dt = GridView1.DataSource as DataTable;
Hope it helped
Thanks
Vipul

Jennifer JonesPosted Aug 8, 2022, 3:19 PM
Thanks! Great advice, didn't know this could be so easy!
pooja guptaPosted Sep 8, 2015, 3:57 AM
good one