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.

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

.NET Framework
Available since 2.0
Return to top
Show: