Hello Experts,
(Web application information- I am using ASP.NET MVC, .Net framework 4 and C#)
I am using jqgrid on a webpage(view) to display contents from model.
$("#list").jqGrid({
url: '<%= @Url.Action("ViewData", "Data") %>',
datatype: 'json',
mtype: 'GET',
...
...
...
toppager: true,
pager: jQuery('#pager'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'ID',
sortorder: "desc",
multiselect: true,
viewrecords: true,
...
...
...
and my controller is this
[SessionExpireFilter]
public ActionResult ViewData(string sidx, string sord, int page, int rows ,GridSettings grid)
{
}
I have applied Virtual Scrolling, so whenever the user will scroll on the page, the data will be loaded in jqgrid.
PROBLEM:
When I debugged the application, the "page" parameter in controller must show incremental values at each scroll but it is not behaving normally.
-If I keep the "sortOrder" as "desc" then the "page" values I get in controller are '1' in first pass, '3' in second pass, '5' in third pass and so on.
-If I keep the "sortOrder" as "asc" then the "page" values I get in controller are '1' in first pass, '2' in second pass, '5' in third pass, '6' in fourth pass and so on.
I have tried my level best to find out where the problem lies but I am not able to find the reason behind this. :(
Any help would be highly appreciated.
Thanks in advance.