We help IT Professionals succeed at work.

Sort persistence & Search gridview arrays

dodgerfan asked
Medium Priority
Last Modified: 2012-05-06
I have an asp.net web page written in C# that displays data in a gridview from a text file. The page is built using an array of objects to display the fields. I enabled paging (a text file can hold several hundred records) and I have it sorting on several of the fields. However, once I move to the next page it loses the sort. I need the page to hold the sort when the user moves back and forth between pages. I cannot seem to get it to work. I also need to be able to search the records. I am not sure how to search the array then display the correct records. I am still learning .net and C#, and have never worked with arrays before this. Any help/samples would be appreciated. Thanks.
Watch Question


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.