How to get data from datagrid in the form datatabl
Hi
In our application, we have editable datagrid, user can update edit multiple rows at once. When user clicks on save button, all the records should be updated simultaneously. On save button we want to use datatable/dataset apporach that is on click of save we want all records from grid in the form Datatable/Dataset for data we written following statement on save button click event:
DataTable dt = dgViewHedge.DataSource as DataTable;
but we got null in dt variable.
Basically our approach is to save all data in once. We want to pass datatable/dataset to dataadapter so it updates at once.
Is there any way, we can get all data from grid in the form of DataTable or Dataset.
With Regards
Sunder Ramani
|