优化基础设施 wpf 数据网格
我应该首先声明,我没有太多关于这个问题的信息,但我想试探一下,看看其他人是否也遇到这个问题。我开始了一份新工作,这里的一些人正在使用 Infragistics WPF 数据网格。选择网格是因为视觉灵活性,但显然当网格中有大量行时,事情开始表现得很差。这可能是由于实现造成的(不确定,还没有进入代码),不应该被视为对控制的负面影响。
还有其他人遇到过并且有什么建议我可以转告给开发人员吗?提前致谢。
编辑*:我认为引入分页可能不是一个选择。网格的用途是显示流入其中的数据。因此,用例是最终用户正在监控 50-100 行,这些行在一秒内更新为新值(又名 - 认为运行股票行情而不是翻阅结果集)
I should start out with the disclaimer that I don't have a lot of info into this problem, but I wanted to put a feeler out to see if anyone else had this problem. I started a new job and some folks here are using Infragistics WPF datagrid. The grid was selected because of the visual flexibility, but apparently when there are large amounts of rows in the grid, things begin to perform very poorly. This is possibly due to implementation (not sure, haven't gotten into the code yet) and shouldn't be taken as a negative on the control.
Has anyone else encountered and have any advice I could pass onto the developers? Thanks in advance.
Edit*: I think introducing paging might not be an option. The grid is being used in such a capacity that it is displaying data streamed into it. So the use case is that the end user is monitoring 50-100 rows that are updating with new values intra-second (aka - think running stock tickers instead of flipping through a result set)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在使用 XamDataGrid 时也遇到问题。尽管我没有合适的版本来尝试此操作,但您可以尝试更改为高性能悬停样式并抑制事件,如下所述:
http://blogs.infragistics.com/forums/p/48307/264160.aspx其余
的建议更加具体,并且处理特定的模式和用例。
以下是基础设施优化的更多概述:
http://help.infragistics.com/NetAdvantage/ WPF/2010.3/CLR4.0/?page=xamData_Performance_Optimizations_Overview.html
I'm having problems with XamDataGrid as well. Although I don't have the right version to attempt this, you might try changing to the high-performance hoverless style, and suppressing events, as described here:
http://blogs.infragistics.com/forums/p/48307/264160.aspx
The rest of the suggestions are a lot more specific and handle particular schemas and use-cases.
Here's a bit more of an overview of Infragistics optimizations:
http://help.infragistics.com/NetAdvantage/WPF/2010.3/CLR4.0/?page=xamData_Performance_Optimizations_Overview.html
我正在使用 Xceed DataGrid,但我最近发现我们的 DataGrid 绑定到视图 (DataGridCollectionView) 而不是数据源 (DataView/DataTable)。
这意味着我们每次刷新都会替换整个视图。
通过绑定到 DataTable,我的代码现在可以立即刷新 DataGrid,其中包含几千行,而以前需要 1-2 秒。
因为大多数网格都是相似的。请验证您的代码如何绑定到进入 DataGrid 的数据。
我在此处发布了一些代码,以防有帮助。
I am using the Xceed DataGrid, but I recently discovered our DataGrid was binding to a View (DataGridCollectionView) and not to a datasource (DataView/DataTable).
This meant we replaced the entire view for each refresh.
By binding to a DataTable, my code now refreshes the DataGrid instantly with a few thousand rows where it use to take 1-2 seconds.
As most grids are similar. please verify how your code is binding to the data that goes into your DataGrid.
I posted some code here in case that helps.
采取的方法是启用虚拟化——这确保只有屏幕上的信息参与重绘。持续更新 100 行没有问题。
The approach is take is to enable virtualisation - this ensure that only the information on the screen is involved in a repaint. See no problem with 100 rows being continuously updated.