Paging Problem with Data Grid
-
Hi all, I am Showing some record in Data Grid, Data grid have also Edit and Delete Button, I also use Paging for Data Grid ( 10 Record per Data Grid). Problem is that, Suppose i have 11 record, and i am on Last page where only 1 record is showning, when i delete this last record,it gives the error "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount in ASP.Net". I think it is Paging Error, but i not Resolve that..... Any Help is Highly appreciated.... Thanx in advance Sajjad
-
Hi all, I am Showing some record in Data Grid, Data grid have also Edit and Delete Button, I also use Paging for Data Grid ( 10 Record per Data Grid). Problem is that, Suppose i have 11 record, and i am on Last page where only 1 record is showning, when i delete this last record,it gives the error "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount in ASP.Net". I think it is Paging Error, but i not Resolve that..... Any Help is Highly appreciated.... Thanx in advance Sajjad
-
Hi there, After deleting the record, you also need to set the CurrentPageIndex property back to 0.
We can't do this, because if we set the CurrentPageIndex property = 0 , so every deletion it goes back to First page.......
-
We can't do this, because if we set the CurrentPageIndex property = 0 , so every deletion it goes back to First page.......
-
Hi all, I am Showing some record in Data Grid, Data grid have also Edit and Delete Button, I also use Paging for Data Grid ( 10 Record per Data Grid). Problem is that, Suppose i have 11 record, and i am on Last page where only 1 record is showning, when i delete this last record,it gives the error "Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount in ASP.Net". I think it is Paging Error, but i not Resolve that..... Any Help is Highly appreciated.... Thanx in advance Sajjad
In your delete method you must check to see if the item was the last on the page and then decrease the currentpageindex Regards, Alexandru Savescu