Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
ListView Class
ListView Properties
 VirtualMode Property

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
ListView.VirtualMode Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value indicating whether you have provided your own data-management operations for the ListView control.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Visual Basic (Declaration)
Public Property VirtualMode As Boolean
Visual Basic (Usage)
Dim instance As ListView
Dim value As Boolean

value = instance.VirtualMode

instance.VirtualMode = value
C#
public bool VirtualMode { get; set; }
C++
public:
property bool VirtualMode {
    bool get ();
    void set (bool value);
}
J#
/** @property */
public boolean get_VirtualMode ()

/** @property */
public void set_VirtualMode (boolean value)
JScript
public function get VirtualMode () : boolean

public function set VirtualMode (value : boolean)

Property Value

true if ListView uses data-management operations that you provide; otherwise, false. The default is false.
Exception typeCondition

InvalidOperationException

VirtualMode is set to true and one of the following conditions exist:

When you set the VirtualMode property to true, you should handle the RetrieveVirtualItem event, providing a valid ListViewItem.

If the View property is set to Tile, the value will automatically be changed to LargeIcon when VirtualMode is set to true.

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Caching, ListViewItem.Selected, ListViewItem.Checked, et al.      Peter Ritchie   |   Edit   |   Show History

Caching

There has been some misconceptions as to what virtual mode does.  When VirtualMode is set to false, any and all need for ListView item data invokes a ListView.RetrieveVirtualItem Event (this includes repaints).  The ListView performs absolutely no caching of ListView item data when VirtualMode is true, it is the responsibility of the application programmer subscribing to the RetrieveVirtualItem event to perform and caching, if needed.

The ListView.CacheVirtualItems event does not imply that the ListView performs caching, it's a hint to the subscriber of the RetreiveVirtualItem that a block of ListView items is about to be requested and perform any caching they see fit.  The ListView does not perform the caching.

ListViewItem properties and VirtualMode = true

When VirtualMode is true, ListViewItem's retrieved via properties and methods like the Items property would be created via raising the ListView.RetrieveVirtualItem Event (aka by calling ListView.OnRetrieveVirtualItem()). In pre-release versions of .NET 2.0 (CTPs, Betas), raising some RetrieveVirtualItem events did not connect the ListViewItem object to the ListView object (if the RetrieveVirtualItem event handler didn't) resulting in the ListViewItem being disconnected from the ListView object.  Changing ListViewItem properties, therefore, would have no affect--they would not be delegated back to the list view.  This is not the case in release versions of .NET 2.0.

Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker