0
votes

I am having a GridView binded with an object data source. I got custom paging and sorting on my gridview , which i did by using LINQ2SQL . The problem i am facing now is , that if a user search something and click search , the gridview will be binded with 8 pages. Now if a user changes the search filters on the page(supposing this search will only have 2 pages) and rather then clicking search , he changes the page number to 7 for the currently bind gridview records. This user action will bind the gridview but this time in my LINQ2SQL i would be getting the start row index on the basis on of selected page index, which i want it to be 0 , since the search filters have changed.

So i am wondering how you would cater it , would you be hiding gridview paging if a user changes search filter values or you will be setting a bit for checking filter old values and new values?

Thanks

Edit: when i try doing the above on google search , on page index changing the google will not consider the current search field value , it will still be doing paging on the last binded search results.

1
is "search" fired when you change page? - Adil Mammadov
yes , it is fired. because i have custom LINQ2SQL Paging so i am calling the SearchLogic() after a page index has changed. - Hassan Humayun

1 Answers

0
votes

I have solved the problem , by setting properties on the page , i Saved search filter values in viewState and used the same properties to render my form on Page_PreRender.