简体   繁体   中英

Displaying a Large Amount of Data

I'm working on a media library mock-up and I have a database of songs (over 9,000 tracks) that I want to display and make sortable. I'm not sure which GUI control would be best to use and I am not sure how it would be best to add all of the entries to the control.

Obviously using a listview and adding each entry one at a time takes a long time. Currently, the database is returning all of the tracks in an array of media objects ( mediaEntry[] - a struct I defined). I don't know much about .NET's databinding system and any performance benefit that may bring.

The database is also searchable so I'll be changing the information displayed in the GUI control depending on the search terms.

Something like DataGridView or ListView in "virtual mode" should work well; this avoids the need to process all the data up-front.

however - I doubt that mediaEntry should be a struct - sounds like a class to me. It is very rare you write a struct in .NET

The Listview control has a virtual mode, where you supply the viewable data on demand. Its actually easier to use than it sounds. Checkout the VirtualMode property and the RetrieveVirtualItem event.

You may want to give ObjectListView a try. It's very handy to use and has excellent performance when used appropriately .

Note: I'm not the developer of this library, I'm advertising it just because I used it in one of my projects.

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