This documentation is archived and is not being maintained.

ListViewGroup.Items Property

Gets a collection containing all items associated with this group.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[BrowsableAttribute(false)]
public ListView..::.ListViewItemCollection Items { get; }

Property Value

Type: System.Windows.Forms.ListView.ListViewItemCollection
A System.Windows.Forms.ListView.ListViewItemCollection that contains all the items in the group. If there are no items in the group, an empty System.Windows.Forms.ListView.ListViewItemCollection object is returned.

You can assign an item to a group by specifying the group in the ListViewItem constructor, by setting the ListViewItem.Group property, or by directly adding the item to the Items collection of a group. All items should be assigned to groups before they are displayed. Any items that are not assigned to a group will appear in the default group, which has the header label "DefaultGroup{0}". The default group is not contained in the ListView.Groups collection, and cannot be altered. It is primarily useful in debugging to ensure that all items have been properly added to groups.

An item can only be in one group at a time. You can change the group to which an item belongs by setting the ListViewItem.Group property at run time or by adding it to the Items collection of another group, which automatically removes it from the previous group.

NoteNote:

An item can be present within the Items collection of a group, but if it is not also present within the ListView.Items collection of the ListView control itself, it will not appear in the control.

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

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.

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: