?
Solved

gridview sort

Posted on 2014-04-10
3
Medium Priority
?
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

741 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