searching AND paging?
-
I have a datagrid in which I have 'Paging' functionality of type numeric (pages 1 to 10....) and also a search functionality wherein the user enters say name or branchname or recordno in the text box and the datagrid searches the desired record/s. My problem is the 'search' functionality works only the first page (or parent page) of the datagrid but when I am on say page no 2 or 4 or 10 etc... it doesn't work it comes with the following error: System.Web.HttpException: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount. My code for paging is as follows: '*********************************************************************** Sub DataGrid_PageChanger(Source As Object, E As DataGridPageChangedEventArgs) ' Set the CurrentPageIndex before binding the grid DataGrid.CurrentPageIndex = E.NewPageIndex Refreshgrid(Cint(ddlBranch.SelectedItem.Value),txtsearch.text) End Sub '*********************************************************************** Any suggestions? Thanks a ton!!! Aartee. ...HE is watching Us All!