This is a migrated thread and some comments may be shown as answers.

[Solved] Issue with Paging due to Filter on Edit in Telerik Grid

1 Answer 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shravan
Top achievements
Rank 1
Shravan asked on 13 Jul 2012, 07:49 PM
I am working on a MVC Telerik Grid. Setting page size to 10. I have some default filter resulting 20 records. Now if I remove the filter I will have 100 records, I go on page 8 to edit in a popup window 82nd record, after returning from edit, no record is on display and paging shows 'Displaying items 81 - 20 of 20', similar issue shows up on http://demos.telerik.com/aspnet-mvc/grid/editingajax when you delete one by one all the 7 records on last page and it will show no record with paging in the bottom 'Displaying items 71 - 70 of 70'.

Hope you understand the issue, please suggest any solution for this.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 18 Jul 2012, 03:12 PM
Hi,

 Indeed the MVC grid will not show you the previous page when all records are removed. You can however do that via code by handling the OnDataBound event:

function onDataBound() {
      var grid = $(this).data("tGrid");
 
      if (grid.data.length < 1 && grid.currentPage > 1) {
        grid.pageTo(grid.currentPage -1);
      }
}

Regards,
Atanas Korchev
the Telerik team
Check out the successor of Telerik MVC Extensions - Kendo UI for ASP.NET MVC - and deem it for new ASP.NET MVC development.
Tags
Grid
Asked by
Shravan
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or