Solved

gridview sort

Posted on 2014-04-10
3
284 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 74

Expert Comment

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

Accepted Solution

by:
CodeCruiser earned 250 total points
Comment Utility
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
Comment Utility
looks like all is working, I would close the question t'row after testing one more thing. Thanks a lot
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now