强制显示 ASP.NET GridView 的分页器
有没有办法强制显示 gridview 的分页器,即使屏幕上只有一页数据?
我正在使用自定义分页器(带有页面大小的下拉菜单)构建基于 gridview 的控件,并且一切正常,除非用户选择大于网格当前行数的页面大小。 此时寻呼机就消失了。 我一直在谷歌搜索这个,我认为我应该在重写 OnRowCreated 中做一些事情...
自定义分页器是通过重写 InitializePager 添加的。 如果需要,我很乐意提供更多信息!
问候, 阿罗拉
is there some way to force the gridview's pager to show up, even when there is only one page of data on screen?
I'm building a gridview-based control with a custom pager (w/dropdown for pagesize) and everything is working fine, except when user selects pagesize that is larger than the current row count of the grid. At that point the pager disappears. I've been googling this and i think that i should be doing something in override OnRowCreated...
Custom pager is added by overriding InitializePager. I'll be glad to provide more information if required!
greets,
J.Arola
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好的,这并不太难:-)
根据我的初步测试,以下方法实现了这一点:
我只是将其添加到重写 OnPreRender,瞧,寻呼机是可见的,即使只显示一页数据。 不过,在我确定之前,我必须做一些额外的测试。 对我来说似乎很简单。
Ok, that wasn't too hard :-)
Based on my initial testing the following did the trick:
I just added that to overridden OnPreRender, and lo, pager is visible, even when there is just one page page of data shown. Got to do some additional testing before I can be sure, though. Seems to simple to me.
以上将起作用
但这也可能有帮助
The above will work
But this might be helpful also
GridView.BottomPagerRow.Visible=true 就像魅力一样
GridView.BottomPagerRow.Visible=true works like a charm