Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Convert DataGrid to datatable

Reply
Thread Tools

Convert DataGrid to datatable

 
 
martin
Guest
Posts: n/a
 
      07-06-2004
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


 
Reply With Quote
 
 
 
 
Bobby Ryzhy
Guest
Posts: n/a
 
      07-06-2004
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




On Wed, 7 Jul 2004 08:52:52 +1200, "martin"
<(E-Mail Removed)> wrote:

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


 
Reply With Quote
 
 
 
 
martin
Guest
Posts: n/a
 
      07-06-2004
Thank you,

I will try this..


"Bobby Ryzhy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>
>
> On Wed, 7 Jul 2004 08:52:52 +1200, "martin"
> <(E-Mail Removed)> wrote:
>
> >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
> >

>



 
Reply With Quote
 
Bobby Ryzhy
Guest
Posts: n/a
 
      07-07-2004
Anytime.

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

On Wed, 7 Jul 2004 11:34:45 +1200, "martin"
<(E-Mail Removed)> wrote:

>Thank you,
>
>I will try this..
>
>
>"Bobby Ryzhy" <(E-Mail Removed)> wrote in message
>news:(E-Mail Removed).. .
>> 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
>>
>>
>>
>>
>> On Wed, 7 Jul 2004 08:52:52 +1200, "martin"
>> <(E-Mail Removed)> wrote:
>>
>> >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
>> >

>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort a datatable and create a new datatable Fredrik Rodin ASP .Net 3 09-28-2007 07:28 AM
How can I add a row from a typed datatable to another instance of that typed datatable? Ersin Gençtürk ASP .Net 1 10-06-2004 01:11 PM
Create a Datatable from a SQL datatable column shema? jg ASP .Net 1 08-17-2004 09:43 PM
Casting DataTable to class inherit from DataTable =?Utf-8?B?Qmx1ZWZsb3dlcg==?= ASP .Net 0 04-02-2004 05:41 AM
Adding DataTable Rows To another DataTable J. Babe ASP .Net 1 08-15-2003 05:04 PM



Advertisments