Gridview sorting
-
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.
-
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.
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.
-
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.
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.