[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

gridview sort

Posted on 2014-04-10
3
Medium Priority
?
309 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 1000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

831 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