简体   繁体   English

DataGridView,大规模数据绑定解决方案

[英]DataGridView, large scale databinding solutions

I developed an application that uses a DataGridView, and can have upwards of 500k rows in it. 我开发了一个使用DataGridView的应用程序,其中可以包含多达50万行。 It is structured like this currently: 当前的结构如下:

DataGridView.DataSource is a BindingSource
BindingSource.DataSource = AggregateBindingListView
AggBLV.SourceLists = {Lists of Data}
AggBLV.Sort("PropertyName")
AggBLV.ApplyFilter(Predicate)
...

The AggregateBindingListView is a collection that implements: Component, IBindingListView, IList, IRaiseItemChangedEvents, ICancelAddNew, ITypedList AggregateBindingListView是一个实现的集合:Component,IBindingListView,IList,IRaiseItemChangedEvents,ICancelAddNew,ITypedList

It is excellent piece of code developed by http://blogs.warwick.ac.uk/andrewdavey 这是由http://blogs.warwick.ac.uk/andrewdavey开发的优秀代码。

Anyways. 无论如何。 We've been using it for 4 years, and its become a performance bottleneck. 我们已经使用了4年,它已成为性能瓶颈。

So here is my question: 所以这是我的问题:

I have a Collection of 500k items, and would like to bind them to a DataGridView. 我有一个500k项的集合,并想将它们绑定到DataGridView。 I need it to have Multi-Column sorting, Predicate Filtering, and A priority on performance. 我需要它具有多列排序,谓词过滤和性能优先级。

We've just upgraded to C# 4.0. 我们刚刚升级到C#4.0。

Can I do better than what I have? 我可以做得比我现有的更好吗? I can post timing statistics and the such, but i'd need something for comparison. 我可以发布时间统计信息等等,但是我需要一些比较信息。

You could try to use data virtualization as shown here . 您可以尝试使用此处所示的数据虚拟化。 It's intended for WPF, but it could probably work in WinForms with minor adaptations. 它是为WPF设计的,但它可能在经过少量改动的WinForms中可以工作。 The idea is that instead of holding all the data at once in memory, you only load the necessary "pages" as needed, and unload them when they're not needed anymore. 这样的想法是,您不必只一次将所有数据保存在内存中,而是仅根据需要加载必要的“页面”,并在不再需要它们时将其卸载。

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

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