Convert DataGrid to datatable

  • Thread starter Thread starter martin
  • Start date Start date
M

martin

Hi,

Is there an easy way , maybe a cast or something to place all of the items
from a datagrid into a dataset.
Sort of the opposite of binding a datatable to a datagrid.

any help is appreciated.

cheers

martin
 
DataSet ds = new DataSet();
ds.Columns...

DataView dv = new DataView( ds.Tables[0] );

DataGrid grid = new DataGrid();
grid.DataSource = dv;

//Cast as DataView
DataView _newDV = (DataView) grid.DataSource

Bobby Ryzhy
bobby@ name of domain below
http://www.weekendtech.net
 
Thank you,

I will try this..


Bobby Ryzhy said:
DataSet ds = new DataSet();
ds.Columns...

DataView dv = new DataView( ds.Tables[0] );

DataGrid grid = new DataGrid();
grid.DataSource = dv;

//Cast as DataView
DataView _newDV = (DataView) grid.DataSource

Bobby Ryzhy
bobby@ name of domain below
http://www.weekendtech.net




Hi,

Is there an easy way , maybe a cast or something to place all of the items
from a datagrid into a dataset.
Sort of the opposite of binding a datatable to a datagrid.

any help is appreciated.

cheers

martin
 
Anytime.

Bobby Ryzhy
bobby@ name of domain below
http://www.weekendtech.net

Thank you,

I will try this..


Bobby Ryzhy said:
DataSet ds = new DataSet();
ds.Columns...

DataView dv = new DataView( ds.Tables[0] );

DataGrid grid = new DataGrid();
grid.DataSource = dv;

//Cast as DataView
DataView _newDV = (DataView) grid.DataSource

Bobby Ryzhy
bobby@ name of domain below
http://www.weekendtech.net




Hi,

Is there an easy way , maybe a cast or something to place all of the items
from a datagrid into a dataset.
Sort of the opposite of binding a datatable to a datagrid.

any help is appreciated.

cheers

martin
 
Back
Top