Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using c# for winforms, how to implement page loaded listbox

Status
Not open for further replies.

xpblueScreenOfDeath

Programmer
Sep 1, 2004
87
I have a big table that contains about 100,000 records and I want to display it in a Listbox (ListView or some similar control). The problem is that it takes around 10 secs to load. Do you guys have any tips about how I can implement it as a page loaded listbox?
 
That's probably too many records for the standard controls.

I would look at buying some 3rd party controls which have a "virtual" mode.

The way these typically work is that the control shows 10 items at a time. When the user scrolls up/down to show more, the control raises an event, asking you for more data. You give it the data (from some data store that you have -- arraylist, database query, etc) and it shows it.

The benefits of this are:
1. The control shows much faster, as it only needs to load the data that's visible
2. You use less memory, as you only have as many additional references to your objects as are shown on the screen, rather than n * 4 bytes.
3. Your data has a smaller chance of being stale.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top