asp.net 4.0动态数据GridviewPager指定页数

发布于 2024-09-13 14:58:20 字数 303 浏览 3 评论 0原文

我目前正在一个项目中使用 Dynamic Data Linq to SQL。我想知道是否有一种方法可以更改 GridView 页面上显示的项目数量的可用选项。目前,“每页结果:”下拉列表仅提供 5、10、15 和 20 个选项。我想添加 50 和 100 个选项以每页显示 50 或 100 个项目。

GridView 控件使用 GridViewPager 控件生成分页控件/下拉列表。例如,我可以将 GridView 上的 PageSize 属性设置为 50,并且每页显示 50 个项目,但如何更改 GridViewPager 以让用户选择 50 或 100 的其他选项?

I am currently using Dynamic Data Linq to SQL for a project. I was wondering if there is a way to change the available options for the number of items to display on a page for the GridView. Currently the "Results Per Page:" drop down list only gives me options for 5, 10, 15 and 20. I want to add 50 and 100 options to display 50 or 100 items per page.

The GridView control is using the GridViewPager control to generate the paging controls/dropdown list. I can set the PageSize property on the GridView to 50 for example and have 50 items showing per page, but how do I change the GridViewPager to let the user pick the additional options of 50 or 100?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葬﹪忆之殇 2024-09-20 14:58:20

好的。我想通了。 DynamicData\Content 中有一个名为 GridViewPager.ascx 的文件,它实际上控制分页。您将在源代码中看到有一个下拉列表,您可以添加其他列表项值。

Okay. I figured it out. There is a file in DynamicData\Content called GridViewPager.ascx that actually controls the paging. You'll see in the source that there is a dropdownlist and that you can add additional listitem values.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文