简体   繁体   English

Asp.net devexpress网格视图自定义分页

[英]Asp.net devexpress grid view custom paging

I have developed a devexpress grid in my application. 我已经在我的应用程序中开发了一个devexpress网格。

In that grid the data are around 10000 and all records are binding on page load event . 在该网格中,数据大约为10000,并且所有记录在页面加载事件时都绑定。

But I am facing an issue regarding performance. 但是我遇到了有关性能的问题。 It will take more time to bind the 10000 records so I need to bind only 10 (page size) records on 1st page on page load. 绑定10000条记录将花费更多时间,因此在页面加载的第一页上我只需要绑定10条(页面大小)记录。

Is there any way that bind only pagesize records on page load and bind another when page index has changed? 有什么方法可以只在页面加载时绑定页面大小记录,而在页面索引更改时绑定另一个?

Please help me with this 请在这件事上给予我帮助

I suggest you use the Server-Mode data binding . 我建议您使用服务器模式数据绑定 If a grid contains a lot of records, it is recommended to bind it using Database Server Mode . 如果网格包含很多记录,建议使用Database Server Mode绑定它。 This mode is specially designed to work with large data and provide much better performance in this case. 此模式是专门为处理大数据而设计的,在这种情况下可以提供更好的性能。

To switch grid pages using the scrollbar, use the grid's Virtual Scrolling feature. 要使用滚动条切换网格页面,请使用网格的虚拟滚动功能。 Please refer to the Grid - Data Paging and Scrolling . 请参考网格数据分页和滚动 Virtual Scrolling online demo to see this approach in action. 虚拟滚动在线演示演示了这种方法的实际效果。

References: 参考文献:
ASPxGridView with large data 带有大数据的ASPxGridView
ASPxGridView - How to bind the grid to a large dataset ASPxGridView-如何将网格绑定到大型数据集
How to load a large DataSet to ASPxGridView without using a datasource 如何在不使用数据源的情况下将大型数据集加载到ASPxGridView
ASPxGridView - How to bind a gridiview with a large data set to different data sources created at run time ASPxGridView-如何将带有大数据集的gridiview绑定到在运行时创建的不同数据源
ASPxGridView - How to improve performance for large data set ASPxGridView-如何提高大型数据集的性能

I'm not sure why you need custom paging. 我不确定为什么需要自定义分页。 However dev express has paging controls built into their framework you can use, have a look at this page here. 但是dev express在您可以使用的框架中内置了分页控件,请在此处查看此页面。

Pager Settings and example 传呼机设置和示例

You will be able to use their code where it handles pages sizes which should help with your performance issues and far easier than building your own solution. 您将能够在处理页面大小的地方使用他们的代码,这应该有助于解决性能问题,并且比构建自己的解决方案容易得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM