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

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

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. Marcelo Barbieri

    Sorting multi-page datagrid

    J. Marcelo Barbieri, Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,157
    J. Marcelo Barbieri
    Jun 25, 2003
  2. Simon

    Datagrid sorting

    Simon, Jun 27, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    490
    Simon Wang
    Jun 27, 2003
  3. Replies:
    2
    Views:
    1,773
    James Kanze
    Jul 6, 2010
  4. Andreas Klemt
    Replies:
    0
    Views:
    524
    Andreas Klemt
    Oct 8, 2003
  5. AlainCD
    Replies:
    0
    Views:
    375
    AlainCD
    Jan 12, 2006
  6. Jason
    Replies:
    0
    Views:
    790
    Jason
    Oct 4, 2006
  7. Tom Kirchner

    sorting by multiple criterias (sub-sorting)

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

    Sorting a set works, sorting a dictionary fails ?

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