C# - DataGrid/DataSet issue

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!
 
J

John J. Hughes II

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top