C# - DataGrid/DataSet issue

  • Thread starter Thread starter David
  • Start date Start date
D

David

In C#, when I create a DataGrid, use a SetDataBinding to set the data
to the dataset, then update the datagrid, is there a way to get a
dataset object back from the DataGrid control so that I can use it to
update, add, etc.

Eg. I can see how to get data into the DataGrid object but not back
out!
 
Not sure I understand correctly but this is what I do:

DataGrid1.Datasource = DataSet1;
DataGrid1.DataMemboer = "Table1";

DataSet ds = (DataSet)DataGrid1.DataSource;
ds.Tables[DataGrid1.DataMember];

Hope this helps,
John
 
Back
Top