GridView DropDown PageSize [英] GridView DropDown PageSize
问题描述
我正在尝试为gridview控件创建一个pagesize下拉列表。我能够获得示例(通过下面的链接),但是希望根据数据集中的记录计数构建pagesize下拉列表。如何使用
不同的总记录间隔加载下拉列表,最后一个条目显示所有记录。
I am trying to create a pagesize dropdown list for the gridview control. I am able to get the example (via link below) to work, but would like to build the pagesize dropdown list based on the record count from dataset. How can load the dropdown with different intervals of the total records with the last entry displaying all records.
通过以下链接的示例有效但下拉列表一旦消失就会消失记录显示 并且必须刷新页面才能再次使用。
The example via the link below works but the dropdown list disapears once all the records are displayed and the page has to be refreshed to use again.
http://marss.co。 ua / DropDownListInPager.aspx
推荐答案
如果PageSize =所有记录,那么您的示例将不会为您提供下拉列表。这是因为,在e.Row.RowType == DataControlRowType.Pager条件下创建了drop。对于所有记录,没有分页。
If PageSize = All records then your example will not give you the drop down list. This is because, the drop is created on e.Row.RowType == DataControlRowType.Pager condition. For all records, there is no paging.
如果你想要总是下拉,你需要使用 e.Row.RowType == DataControlRowType.Footer 即下拉列表将显示在页脚区域。
If you want the dropdown always, you need to use e.Row.RowType == DataControlRowType.Footer i.e. The drop down will be shown in the footer area.
谢谢
这篇关于GridView DropDown PageSize的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!