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 8083767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:34:48+00:00 2026-06-05T17:34:48+00:00

I am developing a web app using C#, .net 4. I have a grid

  • 0

I am developing a web app using C#, .net 4. I have a grid view which is bound to a SqlDataSource. There are about more than one crore records of this data source. This is because, I have allowed paging. I have a filter criteria on the same page. User selects options using checkboxes. And then on the event of filter Button, I wrote some code which builds a new SELECT command according to the filter options for SqlDataSource. And after building a new query. I wrote another line of code which is:

DataGridView.SelectCommand= FilteredQuery;

So when user clicks FilterButton, the gridview shows the filtered data. As i told you, I have allowed Paging. So after filteration, when i selects the next button of that gridview, it shows the whole data instead of Filtered one. I think this is because it postsbacks the page and binds the gridview according to the predefined SELECT command for SqlDataSource.

I tried many approaches. I used static bool variable to keep track on page_load event. It works fine then. But it still troubles when i nevigate from one page to another. When i come back to this page, it still shows the filtered data.

I have very less time. Please guide me as soon as possible. Remember, I’m totally new to dot net technologies. So any detailed guidance will be highly appreciated. Thanks.

Best Regards!

  • 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-06-05T17:34:50+00:00Added an answer on June 5, 2026 at 5:34 pm

    You have to create OnPageIndex Changed event

    <asp:GridView ID="yourGrid" runat="server" AutoGenerateColumns="false" OnPageIndexChanged="yourGrid_PageIndexChanged">
    

    And in code behind

    protected void yourGrid_PageIndexChanged(object sender, EventArgs e)
    {
        if (filtered) // you would have to keep track of the filtered state of your grid possibly with hidden field
        {
            DataGridView.SelectCommand = FilteredQuery;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing web app using asp.net. I have plenty of javascript files which
I'm developing an web app using asp.net mvc. I have a List in Cache
I am developing a MySQL Web App using ASP.net and I have heard that
I am currently developing an asp.net web app. I have a class which is
Does anyone have an experience with developing a big web app using ASP.NET MVC
I'm developing my ASP.NET web app using VS2010,C#. I have a user control contained
I'm developing web app using Spring Integration to route my messages, but I have
I'm developing a web app using a cakephp. I've one function in which I
I am developing a web app using servlets and jsps. I have a question
I'm developing a web app. This is more of a line-of-business app rather than

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.