3
Answers

Convert a GridView.DataSource to DataTable or Dataview

Ajay Gautam

Ajay Gautam

14y
46.5k
1
Hi All,
I have one gridview and i want to take all the values in a datatable or dataview.

I tried like this
DataTable gridTable = (DataTable) dataGrid1.DataSource;

but gridTable is showing null, it should not show null because gridview has lot of records with 3 columns

Is there any way i can convert/store a gridview.Datasource records in a datatable or dataview?

Answers (3)