ASP.NET MVC 3的WebGrid分页问题 [英] ASP.NET MVC 3 WebGrid paging issue

查看:333
本文介绍了ASP.NET MVC 3的WebGrid分页问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据访问层返回集合,为行单页和行的总数。

My data access layer returns collection with rows for single page and total number of rows.

不幸的WebGrid组件不允许指定行数或总页数的总数(这些属性是只读的)。

Unfortunately WebGrid component does not allow to specify total number of rows or total number of pages (these properties are read-only).

有没有人有过吗?

推荐答案

您可以使用上的WebGrid的Bind方法来告诉电网使用服务器端分页。

You can use the Bind method on the WebGrid to tell the grid to use server side paging.

grdv.Bind(MYDATA的,rowCount等= 10000,autoSortAndPage = FALSE)

grdv.Bind(myData, rowCount=10000, autoSortAndPage=False)

设置autoSortAndPage为false告诉网格,myData的只是一个数据段。它会显示这个数据的所有行不管你的页面大小设置。寻呼机将使用rowCount等你在通和不记录的数目在myData的构建

Setting autoSortAndPage to false tells the grid that myData is just a segment of the data. It will show all rows of this data regardless of your page size setting. Pager will be built using the rowCount you pass in and not the number of records in myData.

这篇关于ASP.NET MVC 3的WebGrid分页问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆