Export (0) Print
Expand All

ListViewGroup.Items Property

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

Gets a collection containing all items associated with this group.

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

public ListViewItemCollection Items { get; }
/** @property */
public ListViewItemCollection get_Items ()

public function get Items () : ListViewItemCollection

Property Value

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 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

Community Additions

ADD
Show:
© 2015 Microsoft