sorting a datagrid

Discussion in 'ASP .Net Datagrid Control' started by Robin, Jul 7, 2004.

  1. Robin

    Robin Guest

    Robin, Jul 7, 2004
    #1
    1. Advertising

  2. Robin

    Scott M. Guest

    Private Sub DataGrid1_SortCommand(ByVal source As Object, _
    ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) _
    Handles DataGrid1.SortCommand
    Dim dv as new DataView(DataTableThatHasOriginalUnsortedDataInIt)
    dv.Sort = e.SortExpression
    DataGrid1.DataSource = dv
    DataGrid1.DataBind()
    End Sub

    "Robin" <> wrote in message
    news:...
    > In asp.net I have created a datagrid which it data source is determined at
    > runtime. How can add the auto sort functionality to this datagrid?
    > In the MSDN article
    >

    http://msdn.microsoft.com/library/d...ml/vbtskaddingsortingtodatagridwebcontrol.asp
    > it has some code but it does not show where dataview1 is created.
    >
    >
    >
    >
     
    Scott M., Jul 7, 2004
    #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:
    2
    Views:
    1,489
    James Kanze
    Jul 6, 2010
  2. AlainCD
    Replies:
    0
    Views:
    213
    AlainCD
    Jan 12, 2006
  3. Jason
    Replies:
    0
    Views:
    411
    Jason
    Oct 4, 2006
  4. Tom Kirchner

    sorting by multiple criterias (sub-sorting)

    Tom Kirchner, Oct 11, 2003, in forum: Perl Misc
    Replies:
    3
    Views:
    510
    Michael Budash
    Oct 11, 2003
  5. Íéêüëáïò Êïýñáò

    Sorting a set works, sorting a dictionary fails ?

    Íéêüëáïò Êïýñáò, Jun 10, 2013, in forum: Python
    Replies:
    12
    Views:
    169
    Ulrich Eckhardt
    Jun 10, 2013
Loading...

Share This Page