数据网格分组性能

数据网格分组性能

本文介绍了数据网格分组性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我们首先问您认为WPF DataGrid的LARGE数据集是什么.该矿最多可攀登9000行,有24列.在下面引用.主要问题是...即使我将刷新推迟到处理结束,我仍然 获得缓慢的分组"性能,甚至由于内存"问题而导致程序崩溃.我的自定义排序性能从单击到显示9000行仅需要5秒钟(带有或不带有虚拟化). .有东西吗 我可以做些什么来改善分组效果?我当前正在使用GroupDescriptions在作为该数据网格的数据源的ListCollectionView上进行分组.
Lets start off by asking what do you consider a LARGE data set to be for a WPF DataGrid.  Mine climbs up to 9000 rows and has 24 columns.  Referenced Below.  The main question is... even if I defer refresh to the end of processing, I still get a slow 'grouping' performance, and even program crash due to 'memory' issues.  My custom sorting performance only takes up to 5 seconds from click to show on the 9000 rows (with or without virtualization).  Is there something I can do to improve Grouping performance?  I am currently using GroupDescriptions to perform grouping on the ListCollectionView that is the data source for this datagrid.

推荐答案

如果在WPF DataGrid中执行分组操作,则虚拟化将无法​​进行. DG不知道如何将树上不存在的项目分组.将DataGrid分组后,所有原始DataGridRows都将显示在可视树上,而所有 测量和安排操作将花费大量时间.根据我的了解,在分组后启用虚拟化并非直截了当.但是,您可能需要尝试一种解决方法.您可以将Items的可见性绑定到其IsExpanded 财产.这样做折叠的项目不会显示在视觉树上.供您参考,有一个第三方控件Xceed DataGrid甚至在对数据进行分组时也支持UI虚拟化: http://xceed.com/Grid_WPF_Features.html

The virtualization would not work if you perform Grouping operations in WPF DataGrid. DG has no idea to group items which do not exist on the trees. Once you group the DataGrid, the all original DataGridRows are represented on the visual tree, and all the Measure and Arrange operations will take considerable time. Based on my knowledge it's not straight-forward to enable Virtualization after grouping. But there is one workaround you may want to have a try. You could bind the visibility of Items to its IsExpanded property. By doing so items which are collapsed are not shown on the visual tree. For your reference there is one third-party control Xceed DataGrid which supports UI virtualization even when grouping data:http://xceed.com/Grid_WPF_Features.html

希望此信息对您有所帮助!如果您仍有任何疑问,请随时告诉我.

Hope this information is helpful for you! If you still have any concerns please feel free to let me know.

最诚挚的问候

 


这篇关于数据网格分组性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 01:00