datagrid sort issue

Discussion in 'ASP .Net Datagrid Control' started by sam, Sep 2, 2004.

  1. sam

    sam Guest

    Hello group,
    The webpage I am working with has 3 datagrids. All the 3
    datagrids pretty much does the same thing expect for some minor
    variations.
    I have a print version link in the page and when I try to
    view the "print version" after sorting based on particular columns,
    the sort order reverts back to the original datagrid. I preserve the
    sortorder and sortcolumn properties in viewstate and after the
    postback(click on the "print version" link), sort it again to retain
    the sort order. But for some reason, the sort order doesnt remain in
    place. Here is the code I use:

    If Me.IsPrintVersion Then
    dtpart1 = dsWIP.Tables(1) ' dsWIP is a dataset containing
    multiple tables.
    dvWIP = New DataView(dtpart1)
    dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder
    dgwip.datasource = dvWIP.Table
    Me.dgWIP.DataBind()
    'Me.dgWIP.DataSource = addHeaderLines(dtpart1, 1)
    'Me.dgWIP.DataBind()
    --- (Trying to use the "addHeaderLines" function which
    inserts related headers for every page but cant get the simple thing
    to work.. So, once the sort issue is resolved, I would let you'all
    know abt the addHeaderLines function.)
    Else
    dgWIP.AllowSorting = True
    dgWIPPart2.AllowSorting = True
    dgWIPPart3.AllowSorting = True
    Me.dgWIP.DataSource = dsWIP.Tables(1)
    Me.dgWIP.DataBind()

    thisColor = Color.Gainsboro
    End If


    The "sortColumn" and "sortOrder" has the desired values but for some
    reason, the sort doesnt reflect on the datagrid(dgwip).

    Any help would be appreciated!!


    Thanks,
    Sam.
    sam, Sep 2, 2004
    #1
    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. Eugene
    Replies:
    0
    Views:
    476
    Eugene
    Sep 28, 2004
  2. nobody
    Replies:
    0
    Views:
    530
    nobody
    Jun 1, 2004
  3. JerryJ
    Replies:
    11
    Views:
    1,389
    Dave Moore
    Apr 28, 2004
  4. John Black
    Replies:
    6
    Views:
    2,049
    John Harrison
    May 28, 2004
  5. Navin
    Replies:
    1
    Views:
    675
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page