create a dataview from a datagrid

Discussion in 'ASP .Net Datagrid Control' started by William French, Dec 3, 2003.

  1. Does anyone know how to create a dataview from a datagrid. The
    examples I see for sorting are persisting the dataset, datatable, or
    dataview in viewstate. It seems like a waste for the datagrid and the
    dataview to both be stored in viewstate. Any ideas would be greatly
    appreciated.
    William French, Dec 3, 2003
    #1
    1. Advertising

  2. William French

    Paul Guest

    Bill,
    One way is to set the DataView Table property to the table that you use
    to populate the grid.

    Dim dv as New DataView
    dv.table = yourDataSet.yourTable
    dv.sort "IDField DESC"
    DataGrid1.DataSource = dv
    DataGrid1.DataBind




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Paul, Dec 15, 2003
    #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. Replies:
    1
    Views:
    4,746
    Patrick.O.Ige
    Nov 5, 2005
  2. fabrice
    Replies:
    1
    Views:
    1,922
    =?Utf-8?B?RWx0b24gVw==?=
    Dec 15, 2005
  3. Replies:
    5
    Views:
    3,500
  4. Replies:
    0
    Views:
    568
  5. CodeMonkey
    Replies:
    1
    Views:
    715
    joyal jhaveri
    Feb 4, 2011
Loading...

Share This Page