[RESOLVED]WebGrid with Pagination for Delete Operation

Hi

I am using webgrid to display the list of records. Now I want to implement the delete functionality with paging.

For example:

if we have 21 records and gird show 10 records per page. So here, grid will have
3 pages. On the last page, there is only 1 record.

Now, when we perform delete operation, the grid should show the
previous page. i.e. 2nd page

Currently,  gird shows no records for the 3rd page. Since last record is deleted.

Kindly help in this case. 

Thanks

you would need to rebind the webgrid after deleting the record

refresh page after deleting record that will rebind web grid.

Hi,

According to your description, I think you delete the record through AJAX and remove the item directly.

For this issue, you need to handle that scenario manually, check current page whether there is the data, if not, get retrieve previous page’s data and display.

Best Regards

Starain

Leave a Reply