大佬教程收集整理的这篇文章主要介绍了asp.net-mvc – 如何在客户端Kendo UI网格中实现服务器端分页在asp.net mvc中,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
将gridPaging设置为true后,网格将发送当前pageSize并跳过。在服务器端,您应该使用提供的信息页面您的数据,并将其与总数量一起返回。以下是代码段:
行动
public ActionResult Products(int pageSize,int skip) { using (var northwind = new NorthwindDataContext()) { var products = northwind.Products; // Get the @R_426_10586@l number of records - needed for paging var @R_426_10586@l = products.Count(); // Page the data var data = products.Skip(skip).Take(pageSizE).ToList(); // Return as JSON - the Kendo Grid will use the response return Json(new { @R_426_10586@l = @R_426_10586@l,data = data }); } }
视图
$("#grid").kendoGrid({ datasource: { transport: { read: { url: "home/products",dataType: "json",type: "POST" } },scheR_732_11845@a: { data: "data",// records are returned in the "data" field of the response @R_426_10586@l: "@R_426_10586@l" // @R_426_10586@l number of records is in the "@R_426_10586@l" field of the response },serverPaging: true // enable server paging } });
参考
使用LINQ分页
Datasource配置设置
以上是大佬教程为你收集整理的asp.net-mvc – 如何在客户端Kendo UI网格中实现服务器端分页在asp.net mvc中全部内容,希望文章能够帮你解决asp.net-mvc – 如何在客户端Kendo UI网格中实现服务器端分页在asp.net mvc中所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。