Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在运行时更改NumericPagerField ButtonCount属性_C#_Asp.net_Runtime_Datapager - Fatal编程技术网

C# 在运行时更改NumericPagerField ButtonCount属性

C# 在运行时更改NumericPagerField ButtonCount属性,c#,asp.net,runtime,datapager,C#,Asp.net,Runtime,Datapager,我使用DataPager和ObjectDataSource在ASP.NET中实现ListView的分页,多年来一直运行良好,但现在问题出现了 我们目前将PageSize设置为15,ButtonCount=5。对于一百万行,我们有超过66k页。问题是:DataPager控件的宽度被限制在一个特定的数字内,并且在第一个块1,2,3中是正常的。。。但是当我们移动到最后一个街区66000,660001,66002,。。。分页控件溢出容器 我们找到了一个解决方案,它基于StartRowIndex和Data

我使用DataPager和ObjectDataSource在ASP.NET中实现ListView的分页,多年来一直运行良好,但现在问题出现了

我们目前将PageSize设置为15,ButtonCount=5。对于一百万行,我们有超过66k页。问题是:DataPager控件的宽度被限制在一个特定的数字内,并且在第一个块1,2,3中是正常的。。。但是当我们移动到最后一个街区66000,660001,66002,。。。分页控件溢出容器

我们找到了一个解决方案,它基于StartRowIndex和DataPager控件的PageSize计算pagenumber,然后使用

(DataPager.Fields[<NumericPagerFieldIndex>] as NumericPagerField).ButtonCount = x
然后,奇怪的事情发生了:当我们移动到最后一页66667时,单击66666,我们都认为它会将页码更改为66666,但不会,而不是66666,66664被选中

我们不知道为什么,有谷歌在附近,也阅读了DataPager的代码,但仍然没有找到任何东西

任何帮助都将不胜感激