ListView performance bug

I am doing some data processing on threads.

When the data has been collected it gets added to a listview.. there maybe up to 5 threads at any one time collecting information. If i have a significant number of records. anything over 1000 seems to do it the performance of my application dies dramatically.

Its worst problem is when i minimize the form and try to restore it again the program and pc lock for about 5 minutes.. I have narrowed this down to being the listview.. DataGrids and custom list boxes i have written do not bring up the same problem..

Is this a bug in the list view.. should i not use list view for anything over 1000 records

I chose to use the listview as i cant seem to get full row select on a data grid.

 

I am developing in c# 2005

 

Thanks



Answer this question

ListView performance bug

  • cynny

    List views (and even list boxes) aren't really designed for a large number of items.  It really depends on what you're doing with it.  Is it in detail mode or does each item have an icon   Is it autosorted (you can temporarily disable this while inserting to dramatically increase performance)   These things are guaranteed to slow things down dramatically.  Nevertheless if you are experiencing a slow down then you should switch to a virtual list view instead.  This involves setting a property(VirtualMode) and handling the request for items (RetrieveVirtualItem).  This will give you the performance you desire as only the items needed for display are shown.  This will even work with sorting provided you sort the entire list external to the list view.

    Michael Taylor - 1/3/06


  • ListView performance bug