.Net Framework 4 中是否提供自定义分页,如果是,我们如何实现?
.Net Framework 4 中是否提供自定义分页,如果是,我们如何实现?
目前我正在通过使用 GridView.VirtualItemCount 来实现此功能,但这在 .NET 4 中不可用。
Was custom pagination available in .Net Framework 4, If yes how we can implement?
Currently I am implementing this by using GridView.VirtualItemCount however this is not avaible in .NET 4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
嗯,看来 VirtualItemCount 在 .net 4.0 中不可用。
但是,GridViews 在 .net 4.0 中仍然支持分页。
因此,如果我有一个 gv,并像这样打开分页:
并且要加载的代码 - (不要使用数据读取器加载 - 它们不起作用 - 你需要一个“可交互”的数据源。
所以,要加载的代码网格可以是这样的:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
它输出网格 - 使用工作寻呼机:
因此,似乎没有 virtualItemCount 可用,但您仍然可以使用 .net 4.0 中的 gv 打开数据分页。
Hum, it would seem that VirtualItemCount is not available in .net 4.0.
However, GridViews still supported paging in .net 4.0.
So, if I have a gv, and turn on paging like this:
And code to load - (don't load with a data reader - they don't work - you need a "interable" data source.
So, code to load the grid can be this:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
And it outputs the grid - with a working pager:
So, no virtualItemCount seems to be available, but you can still turn on data paging with the gv in .net 4.0.