System.Windows.Forms.ListView.EndUpdate Method

Resumes drawing of the list view control after drawing is suspended by the ListView.BeginUpdate method.

Syntax

public void EndUpdate ()

Remarks

The preferred way to add multiple items to a System.Windows.Forms.ListView is to use the System.Windows.Forms.ListView.ListViewItemCollection.AddRange(ListViewItem[]) method of the System.Windows.Forms.ListView.ListViewItemCollection (accessed through the ListView.Items property of the System.Windows.Forms.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 System.Windows.Forms.ListView.ListViewItemCollection.Add(string) method of the System.Windows.Forms.ListView.ListViewItemCollection class, you can use the ListView.BeginUpdate method to prevent the control from repainting the System.Windows.Forms.ListView each time an item is added. Once you have completed the task of adding items to the control, call the ListView.EndUpdate method to enable the System.Windows.Forms.ListView to repaint. This way of adding items can prevent flickered drawing of the System.Windows.Forms.ListView when a large number of items are being added to the control.

If ListView.BeginUpdate is called more than once, ListView.EndUpdate must be called an equivalent number of times. Until the last call to ListView.EndUpdate the System.Windows.Forms.ListView will not repaint. Other than this, multiple calls to ListView.BeginUpdate have no effect.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0