Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Gridview sorting

Gridview sorting

Scheduled Pinned Locked Moved ASP.NET
algorithmscsharpcssdatabasewpf
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Naveed Kamboh
    wrote on last edited by
    #1

    Hi Friends, I am binding a grid view using Generic List. I am using c#. I am sorting my gridview and its perfectly working. In my grid view I've a link button which takes user to the Details page of teh recod to view the page. working perfectly. Problem is: When your clicks on search button I am querying database with default order by organisationtitle. then if user sorts gridview by post code and clicks on view detail link which takes user to the detail view page. Now if user uses browswer button to come back on the search page gridviw automatically sorts the data by title but it should be sorted by post code as user last time click on post code to sort the gridview. Please let me know if you need more details.

    Naveed Kamboh Complexity kills, Write easy code for your self.

    C 1 Reply Last reply
    0
    • N Naveed Kamboh

      Hi Friends, I am binding a grid view using Generic List. I am using c#. I am sorting my gridview and its perfectly working. In my grid view I've a link button which takes user to the Details page of teh recod to view the page. working perfectly. Problem is: When your clicks on search button I am querying database with default order by organisationtitle. then if user sorts gridview by post code and clicks on view detail link which takes user to the detail view page. Now if user uses browswer button to come back on the search page gridviw automatically sorts the data by title but it should be sorted by post code as user last time click on post code to sort the gridview. Please let me know if you need more details.

      Naveed Kamboh Complexity kills, Write easy code for your self.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I'd suggest you need to put the sort order on the URL, so when you go back to the URL that has the initial view, the URL gives you the sort order. The other option is to use the session, but there's no need for that.

      Christian Graus Driven to the arms of OSX by Vista.

      N 1 Reply Last reply
      0
      • C Christian Graus

        I'd suggest you need to put the sort order on the URL, so when you go back to the URL that has the initial view, the URL gives you the sort order. The other option is to use the session, but there's no need for that.

        Christian Graus Driven to the arms of OSX by Vista.

        N Offline
        N Offline
        Naveed Kamboh
        wrote on last edited by
        #3

        Thanks for the reply, I found the solution. I was using Gridview inside asp.net update panel. Removing it from asp.net update panel i got what i wanted. I guess partial page request was an issue.

        Naveed Kamboh Complexity kills, Write easy code for your self.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups