Windows Forms Control - Huge list of file names

Which control would best show a huge (300,000+) list of file names?

I tried DataGridView, but it seems to be too overloaded as well as slow.

Are there any better alternatives?

+4
source share
6 answers

The standard ListView control has a virtual mode designed specifically for your situation. I used it with a million list of strings earlier and it does a good job.

This is a true virtual mode. In other words, the memory allocation and population time of the list remain low regardless of the size of the general list. This is not like a DataGridView, which is really starting to slow down and uses memory in large lists.

To use a set of virtual modes:

VirtualListMode = true VirtualListSize= 300000 

(or any other size of your list now)

Then fire the RetrieveVirtualItem event to populate the on-demand list from your list. You can also handle CacheVirtualItems and SearchForVirtualItem events.

+1
source

Absent.

No USER can handle a single list of 300,000+ entries in a meaningful way. It looks like your design is seriously flawed - do you really need to submit a complete list?

Think about how to use the search box and let users search for file names (use autocomplete / suggestions such as Google et.al.) or create a separate list for each start letter (for example, most address books). Or find another way to reduce the number of entries that the user must choose from.

+4
source

Set the pagination and limit the number of rows displayed by the DataGrid. You can add combobox to jump between pages. This is a standard solution.

also see this post https://stackoverflow.com/questions/2125963/need-help-in-gridview-and-table

0
source

Have you tried ListView with report type? This is a control used by Windows natively in its file browsers.

0
source

After the answer from gotch4. Here 's a good article from CodeProject on how to pager with a DataGridView.

0
source

You might want to check out an ObjectListView, specifically VirtualObjectListView:

http://objectlistview.sourceforge.net/cs/index.html

I forgot which license he issued, so you can look at this before using it in a commercial application.

0
source

Source: https://habr.com/ru/post/1299237/


All Articles