Solved

gridview sort

Posted on 2014-04-10
3
290 Views
Last Modified: 2014-04-21
My user wants gridview to be sorted along with able to remember the sort on coming back to the page, visiting any other page.
0
Comment
Question by:welcome 123
3 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39992447
What is your question?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 250 total points
ID: 39993754
1) To enable sorting, set the AllowSorting property of the gridview to true

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.allowsorting(v=vs.110).aspx


2) Handle the Sorting event of the gridview to get the sorting that the user has applied and store it in session

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sorting(v=vs.110).aspx

3) On page load, if the user had previously sorted the gridview, apply that sorting using the Sort method

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sort(v=vs.110).aspx
0
 

Author Comment

by:welcome 123
ID: 40002720
looks like all is working, I would close the question t'row after testing one more thing. Thanks a lot
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question