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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With