ListViewItem.ListViewSubItemCollection Class
TOC
Collapse the table of content
Expand the table of content

ListViewItem.ListViewSubItemCollection Class

 

Represents a collection of ListViewItem.ListViewSubItem objects stored in a ListViewItem.

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

System.Object
  System.Windows.Forms.ListViewItem.ListViewSubItemCollection

type ListViewSubItemCollection = 
    class
        interface IList
        interface ICollection
        interface IEnumerable
    end

NameDescription
System_CAPS_pubmethodListViewItem.ListViewSubItemCollection(ListViewItem)

Initializes a new instance of the ListViewItem.ListViewSubItemCollection class.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of subitems in the collection.

System_CAPS_pubpropertyIsReadOnly

Gets a value indicating whether the collection is read-only.

System_CAPS_pubpropertyItem(Int32)

Gets or sets the subitem at the specified index within the collection.

System_CAPS_pubpropertyItem(String)

Gets an item with the specified key from the collection.

NameDescription
System_CAPS_pubmethodAdd(ListViewItem.ListViewSubItem)

Adds an existing ListViewItem.ListViewSubItem to the collection.

System_CAPS_pubmethodAdd(String)

Adds a subitem to the collection with specified text.

System_CAPS_pubmethodAdd(String, Color, Color, Font)

Adds a subitem to the collection with specified text, foreground color, background color, and font settings.

System_CAPS_pubmethodAddRange(ListViewItem.ListViewSubItem[])

Adds an array of ListViewItem.ListViewSubItem objects to the collection.

System_CAPS_pubmethodAddRange(String[])

Creates new subitems based on an array and adds them to the collection.

System_CAPS_pubmethodAddRange(String[], Color, Color, Font)

Creates new subitems based on an array and adds them to the collection with specified foreground color, background color, and font.

System_CAPS_pubmethodClear()

Removes all subitems and the parent ListViewItem from the collection.

System_CAPS_pubmethodContains(ListViewItem.ListViewSubItem)

Determines whether the specified subitem is located in the collection.

System_CAPS_pubmethodContainsKey(String)

Determines if the collection contains an item with the specified key.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator to use to iterate through the subitem collection.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIndexOf(ListViewItem.ListViewSubItem)

Returns the index within the collection of the specified subitem.

System_CAPS_pubmethodIndexOfKey(String)

Returns the index of the first occurrence of an item with the specified key within the collection.

System_CAPS_pubmethodInsert(Int32, ListViewItem.ListViewSubItem)

Inserts a subitem into the collection at the specified index.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemove(ListViewItem.ListViewSubItem)

Removes a specified item from the collection.

System_CAPS_pubmethodRemoveAt(Int32)

Removes the subitem at the specified index within the collection.

System_CAPS_pubmethodRemoveByKey(String)

Removes an item with the specified key from the collection.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection.CopyTo(Array, Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. Copies the item and collection of subitems into an array.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Add(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Adds an existing ListViewItem.ListViewSubItem to the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Contains(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Determines whether the specified subitem is located in the collection.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.IndexOf(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Returns the index within the collection of the specified subitem.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Inserts a subitem into the collection at the specified index.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Remove(Object)

Removes a specified item from the collection.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether access to the collection is synchronized (thread safe).

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

This API supports the product infrastructure and is not intended to be used directly from your code. Gets an object that can be used to synchronize access to the collection.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.IsFixedSize

This API supports the product infrastructure and is not intended to be used directly from your code. Gets a value indicating whether the collection has a fixed size.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.Item(Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. Gets or sets the ListViewItem.ListViewSubItem at the specified index within the collection.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<'TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<'TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

A ListViewItem.ListViewSubItemCollection stores ListViewItem.ListViewSubItem objects that represent subitems of a parent ListViewItem in the ListView control. Subitems are only displayed in a ListView control when columns are specified in the Columns property of the ListView control and when the View property of the ListView control is set to Details. The order of subitems in the ListViewItem.ListViewSubItemCollection determines the columns the subitems are displayed in the ListView control.

There are a number of ways to add subitems to the collection. The Add method adds a single ListViewItem.ListViewSubItem to the collection. To add a number of subitems to the collection, you create an array of ListViewItem.ListViewSubItem objects and pass it to the AddRange method. If you want to insert a subitem at a specific location in the collection, you can use the Insert method. To remove subitems, you can use either the Remove method or the RemoveAt method if you know where the subitem is located in the collection. The Clear method enables you to remove all subitems from the collection instead of using the Remove method to remove a single subitem at a time.

In addition to methods and properties for adding and removing subitems, the ListViewItem.ListViewSubItemCollection also provides methods to find subitems in the collection. The Contains method enables you to determine whether a ListViewItem.ListViewSubItem is a member of the collection. Once you know that the subitem is located in the collection, you can use the IndexOf method to determine where the subitem is located in the collection.

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft