Convert DataGrid to datatable

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
 
B

Bobby Ryzhy

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
 
M

martin

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
 
B

Bobby Ryzhy

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top