Gridview rows inverse order

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dotneto
    New Member
    • Feb 2007
    • 36

    Gridview rows inverse order

    Hi,
    I'm working on a gridview with an object datasource. I send the sort expression and sort order to the selecting method through a parameter. It works fine in the ascending order, but in the descending order, when the grids navigates to the first page and shows the data for that page, the first row is in the last position, the last in the first and so on.
    If I navigate away, to another page in the grid, the data is fine, and if i go back to page 1, the data is in the right order now. This is very weird.

    I cannot post much of code. Maybe I'm asking miracles but if anybody have an idea. .
    I checked the datatable returned and the data is in the correct order so the problem comes later.
    Thanks.
  • dotneto
    New Member
    • Feb 2007
    • 36

    #2
    Got an answer from a friend. The grid mantained the sort expression and sort direction so it resorted the data after the data came from the datasource.
    Fixed by resetting the values of sortdirection to the right ones. Like : e.sortdirection = "ASC", or e.sortdirection = "DESC".

    Comment

    Working...