Convert DataGrid to datatable

Discussion in 'ASP .Net' started by martin, Jul 6, 2004.

  1. martin

    martin Guest

    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
     
    martin, Jul 6, 2004
    #1
    1. Advertising

  2. martin

    Bobby Ryzhy Guest

    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"
    <> 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
    >
     
    Bobby Ryzhy, Jul 6, 2004
    #2
    1. Advertising

  3. martin

    martin Guest

    Thank you,

    I will try this..


    "Bobby Ryzhy" <> wrote in message
    news:...
    > 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"
    > <> 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
    > >

    >
     
    martin, Jul 7, 2004
    #3
  4. martin

    Bobby Ryzhy Guest

    Anytime.

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

    On Wed, 7 Jul 2004 11:34:45 +1200, "martin"
    <> wrote:

    >Thank you,
    >
    >I will try this..
    >
    >
    >"Bobby Ryzhy" <> wrote in message
    >news:...
    >> 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"
    >> <> 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
    >> >

    >>

    >
     
    Bobby Ryzhy, Jul 7, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J. Babe
    Replies:
    1
    Views:
    8,434
    Kevin Spencer
    Aug 15, 2003
  2. Fredrik Rodin

    Sort a datatable and create a new datatable

    Fredrik Rodin, Feb 16, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    9,119
    paul.mariotti
    Sep 28, 2007
  3. =?Utf-8?B?Qmx1ZWZsb3dlcg==?=

    Casting DataTable to class inherit from DataTable

    =?Utf-8?B?Qmx1ZWZsb3dlcg==?=, Apr 2, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,039
    =?Utf-8?B?Qmx1ZWZsb3dlcg==?=
    Apr 2, 2004
  4. jg
    Replies:
    1
    Views:
    758
    =?Utf-8?B?U2hhaWxlc2ggSmFubnU=?=
    Aug 17, 2004
  5. Ersin Gençtürk
    Replies:
    1
    Views:
    3,557
    Ersin Gençtürk
    Oct 6, 2004
Loading...

Share This Page