Reputation: 3654
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.
Upvotes: 5
Views: 2651
Reputation: 4867
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.
Upvotes: 0
Reputation: 1063058
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
Upvotes: 6
Reputation: 18815
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.
Upvotes: 1