简体   繁体   中英

DataGridView, large scale databinding solutions

I developed an application that uses a DataGridView, and can have upwards of 500k rows in it. 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

It is excellent piece of code developed by http://blogs.warwick.ac.uk/andrewdavey

Anyways. We've been using it for 4 years, and its become a performance bottleneck.

So here is my question:

I have a Collection of 500k items, and would like to bind them to a DataGridView. I need it to have Multi-Column sorting, Predicate Filtering, and A priority on performance.

We've just upgraded to 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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