Resumes drawing of the list view control after drawing is suspended by the BeginUpdate method.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The preferred way to add multiple items to a ListView is to use the AddRange method of the ListView.ListViewItemCollection (accessed through the Items property of the ListView). This enables you to add an array of items to the list in a single operation. However, if you want to add items one at a time using the Add method of the ListView.ListViewItemCollection class, you can use the BeginUpdate method to prevent the control from repainting the ListView each time an item is added. Once you have completed the task of adding items to the control, call the method to enable the ListView to repaint. This way of adding items can prevent flickered drawing of the ListView when a large number of items are being added to the control.
If BeginUpdate is called more than once, must be called an equivalent number of times. Until the last call to the ListView will not repaint. Other than this, multiple calls to BeginUpdate have no effect.
The following code example demonstrates initializing a ListView control to contain check boxes. It also demonstrates using the BeginUpdate and methods. To run this example, paste the following code into a form containing a ListView named ListView1. Call the InititalizeListView method from the form's constructor or Load method.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.