Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7082229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:01:15+00:00 2026-05-28T07:01:15+00:00

I have a GridView, with sortable headers. If I click on a header to

  • 0

I have a GridView, with sortable headers. If I click on a header to sort accending or descending on a page other than page 1, it sorts correctly and displays the new sortable results on that page. I want to know if it’s possible to perform the sort, and then jump back to the first page, maintaining the last sort preference.

Example:

I have a list of 20 First Names & Last names. I’m currently viewing page 2, records 11-20. The list is currently sorted A-Z (Ascending). When clicking on the the First Name header to sort descending, I want the list to return Z-A, but I want the grid to jump back to page 1, displaying Z-A. How do I do this?

My binding currently looks like this:

                gvBillers.DataSource = dataView;
                gvBillers.DataBind();
                gvBillers.PageIndex = 0;
                gvBillers.HeaderRow.TableSection = TableRowSection.TableHeader;

By setting PageIndex to 0 after doing DataBind does jump back to the first page, but when clicking on the hyperlink in the grid to open that record, it opens the wrong record, so somewhere I’m going wrong…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:01:16+00:00Added an answer on May 28, 2026 at 7:01 am

    You’ll want to set your PageIndex before you DataBind:

    gvBillers.PageIndex = 0; 
    gvBillers.DataSource = dataView; 
    gvBillers.DataBind(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have telerik grid on my page. But it working not correctly. Problem: when
i have followed GridView in my ASP.Net Page: http://s2.imgimg.de/uploads/14b706b38JPG.jpg It should look like this:
I have GridView with CheckBox in it's header and another one in each row:
I have GRIDVIEW in ASP.NET Page and I am converting it into infragistics webdata
I have asp.net's .aspx page. that have GridView let say GridViewParent and Each row
I have a gridview that shows (50)rows of data per page. I have the
I have a gridview and usercontrol on the page, I want to alter gridview
I have gridview with 15 and above columns, I need to freeze the header
I have GridView which I can select a row. I then have a button
Have a gridview control which will show X amount of rows. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.