Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying a Large Amount of Data

Tags:

c#

.net

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.

like image 897
Matt Razza Avatar asked Jul 02 '09 21:07

Matt Razza


2 Answers

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

like image 123
Marc Gravell Avatar answered Sep 25 '22 07:09

Marc Gravell


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.

like image 41
Tim Jarvis Avatar answered Sep 25 '22 07:09

Tim Jarvis