Click here to Skip to main content
15,078,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
I am using gridview for displaying data according to search.
   //in this i wrote code for searching using userid or username or date

i bind the data in button click. Then I wrote Pageindexchanging:
// what my problem is, when i search with userid=4766 it displays the users with the userid in 4 pages of gridview.

But when I click 2nd page it binds complete database. Only first page displays my search details
but 2nd page onwards it binds all the data in the database.

Please give a solution on this.
Updated 26-Jan-11 3:12am

1 solution

The problem is that when you are changing the page, you are binding with all the datasource. This means that when you change the page, you must bind with your search result.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900