Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As Hans says in a comment to the original question, they're both going to have abysmal performance, surpassed only by the displeasure that your users will surely experience at the insanity of so many lines of data being displayed at the same time.</p> <p>But if this is unavoidable in your application (and you provide a <em>very</em> good search function), then you should strongly consider using the <strong>virtual mode</strong> option, regardless of which control you decide to use. This means that you must provide your own data-management operations, rather than relying on the control to do it for you. The advantage is that things are much faster. As the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.virtualmode.aspx" rel="noreferrer">documentation</a> says:</p> <blockquote> <p>Virtual mode is designed for use with very large stores of data. When the <code>VirtualMode</code> property is true, you create a <code>DataGridView</code> with a set number of rows and columns and then handle the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvalueneeded.aspx" rel="noreferrer"><code>CellValueNeeded</code> event</a> to populate the cells. Virtual mode requires implementation of an underlying data cache to handle the population, editing, and deletion of DataGridView cells based on actions of the user. For more information about implementing virtual mode, see <a href="http://msdn.microsoft.com/en-us/library/2b177d6d.aspx" rel="noreferrer">How to: Implement Virtual Mode in the Windows Forms DataGridView Control</a>.</p> </blockquote> <p>Or, for the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.virtualmode.aspx" rel="noreferrer"><code>ListView</code> control</a>:</p> <blockquote> <p>Setting the <code>VirtualMode</code> property to true puts the <code>ListView</code> into virtual mode. In Virtual mode, the normal <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.items.aspx" rel="noreferrer"><code>Items</code></a> collection is unused. Instead, <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listviewitem.aspx" rel="noreferrer"><code>ListViewItem</code></a> objects are created dynamically as the ListView requires them.</p> <p>Virtual mode can be useful under many circumstances. If a <code>ListView</code> object must be populated from a very large collection already in memory, creating a <code>ListViewItem</code> object for each entry can be wasteful. In virtual mode, only the items required are created. In other cases, the values of the <code>ListViewItem</code> objects may need to be recalculated frequently, and doing this for the whole collection would produce unacceptable performance. In virtual mode, only the required items are calculated.</p> <p>In order to use virtual mode, you must handle the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.retrievevirtualitem.aspx" rel="noreferrer"><code>RetrieveVirtualItem</code> event</a>, which is raised every time the <code>ListView</code> requires an item. This event handler should create the <code>ListViewItem</code> object that belongs at the specified index. In addition, the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.virtuallistsize.aspx" rel="noreferrer"><code>VirtualListSize</code> property</a> must be set to the size of the virtual list.</p> <p>Handling the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.searchforvirtualitem.aspx" rel="noreferrer"><code>SearchForVirtualItem</code> event</a> enables searching in virtual mode. If this event is not handled, the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.finditemwithtext.aspx" rel="noreferrer"><code>FindItemWithText</code></a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.findnearestitem.aspx" rel="noreferrer"><code>FindNearestItem</code></a> methods will return null.</p> <p>You can handle the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.cachevirtualitems.aspx" rel="noreferrer"><code>CacheVirtualItems</code> event</a> in order to maintain a cache of <code>ListViewItem</code> objects. If the calculation or lookup to create a <code>ListViewItem</code> object is expensive, maintaining a cache can improve performance.</p> <p>If the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.view.aspx" rel="noreferrer"><code>View</code> property</a> is set to Tile, the value will automatically be changed to LargeIcon when <code>VirtualMode</code> is set to true.</p> <p>In virtual mode, the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.items.aspx" rel="noreferrer"><code>Items</code></a> collection is disabled. Attempting to access it results in an <a href="http://msdn.microsoft.com/en-us/library/system.invalidoperationexception.aspx" rel="noreferrer"><code>InvalidOperationException</code></a>. The same is true of the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.checkeditems.aspx" rel="noreferrer"><code>CheckedItems</code></a> collection and the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.selecteditems.aspx" rel="noreferrer"><code>SelectedItems</code></a> collection. If you want to retrieve the selected or checked items, use the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.selectedindices.aspx" rel="noreferrer"><code>SelectedIndices</code></a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.checkedindices.aspx" rel="noreferrer"><code>CheckedIndices</code></a> collections instead.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload