Create datable/dataview from datagrid

Discussion in 'ASP .Net' started by fabrice, Dec 14, 2005.

  1. fabrice

    fabrice Guest

    hi,

    i have populated and bind a datgrid conrol with a dataset.
    is it possible to recreate a datable which will be populated with data from
    the datagrid.


    I m trying this solution,


    Dim mytable As DataTable = CType(MyDataGrid.DataSource, DataTable).
    But it seems no working.

    If I want to count rows, for example, with this function mytable .Rows.Count
    , i get an error.


    thanks for you help.
    fabrice
     
    fabrice, Dec 14, 2005
    #1
    1. Advertising

  2. If it’s post back, you can’t get datagrid’s data source, unless you re-bind
    the datagrid.

    HTH


    Elton Wang



    "fabrice" wrote:

    > hi,
    >
    > i have populated and bind a datgrid conrol with a dataset.
    > is it possible to recreate a datable which will be populated with data from
    > the datagrid.
    >
    >
    > I m trying this solution,
    >
    >
    > Dim mytable As DataTable = CType(MyDataGrid.DataSource, DataTable).
    > But it seems no working.
    >
    > If I want to count rows, for example, with this function mytable .Rows.Count
    > , i get an error.
    >
    >
    > thanks for you help.
    > fabrice
    >
    >
    >
    >
     
    =?Utf-8?B?RWx0b24gVw==?=, Dec 15, 2005
    #2
    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. Jensen bredal
    Replies:
    0
    Views:
    483
    Jensen bredal
    Oct 14, 2005
  2. Replies:
    1
    Views:
    4,784
    Patrick.O.Ige
    Nov 5, 2005
  3. =?Utf-8?B?QW5kcmV3?=

    dataset datable

    =?Utf-8?B?QW5kcmV3?=, Mar 2, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    452
    =?Utf-8?B?QW5kcmV3?=
    Mar 3, 2006
  4. CodeMonkey
    Replies:
    1
    Views:
    763
    joyal jhaveri
    Feb 4, 2011
  5. William French

    create a dataview from a datagrid

    William French, Dec 3, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    230
Loading...

Share This Page