Skip to main content
Version: 3.5

ListViewItemCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (3.5.0.0)

Represents the collection of items in a ListView control.

public class ListViewItemCollection : IList, ICollection, IEnumerable, IList<ListViewItem>, ICollection<ListViewItem>, IEnumerable<ListViewItem>

Properties

Instance memberCount

Int32: Returns the total number of items in the collection.

Instance memberIsReadOnly

Boolean: Returns a value indicating whether the collection is read-only.

Instance memberItem(index)

ListViewItem: Returns or sets the item at the specified index in the collection.

Throws:

Instance memberItem(key)

ListViewItem: Returns the item with the specified key from the collection.

Methods

Instance memberAdd(text)

Adds a new item with the specified label text to the end of the current collection.

ParameterTypeDescription
textStringThe label text displayed by the ListViewItem.

Returns: ListViewItem. A ListViewItem that represents the item being added to the collection.

Instance memberAdd(key, text)

Creates a new item with the specified key and text, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the ListViewItem.
textStringThe text to display in the ListViewItem.

Returns: ListViewItem. The ListViewItem that was added to the collection.

Instance memberAdd(key, text, imageIndex)

Creates a new item with the specified key, text, and image, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the ListViewItem.
textStringThe text to display in the ListViewItem.
imageIndexInt32The index of the image to display in the ListViewItem.

Returns: ListViewItem. The ListViewItem that was added to the collection.

Instance memberAdd(key, text, imageKey)

Creates a new item with the specified key, text, and image, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the item.
textStringThe text to display in the ListViewItem.
imageKeyStringThe image to display in the ListViewItem.

Returns: ListViewItem. The ListViewItem that was added to the collection.

Instance memberAdd(item)

Adds a previously created item to the end of the collection.

ParameterTypeDescription
itemListViewItemThe ListViewItem to add to the collection.

Returns: Int32. The zero-based index value of the ListViewItem added to the collection.

Throws:

Instance memberAddRange(items)

Adds an array of previously created items to the collection.

ParameterTypeDescription
itemsListViewItem[]An array of ListViewItem objects representing the items to add to the collection.

Throws:

Instance memberClear()

Removes all items from the collection.

Instance memberClear(dispose)

Removes all items from the collection and optionally disposes them.

ParameterTypeDescription
disposeBooleanIndicates whether the removed items should be disposed.

Instance memberContains(item)

Determines whether the specified item is a member of the collection.

ParameterTypeDescription
itemListViewItemThe ListViewItem to locate in the collection.

Returns: Boolean. true if the ListViewItem is a member of the collection; otherwise, false.

Instance memberContainsKey(key)

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

ParameterTypeDescription
keyStringThe name of the ListViewItem to search for.

Returns: Boolean. true to indicate the collection contains a ListViewItem with the specified key; otherwise, false.

Instance memberCopyTo(dest, index)

Copies the entire collection into an existing array at a specified location within the array.

ParameterTypeDescription
destArrayThe destination array.
indexInt32The index in the destination array at which storing begins.

Instance memberGetEnumerator()

Returns an enumerator that can be used to iterate through the collection.

Returns: IEnumerator<ListViewItem>. An IEnumerator that represents the ListViewItemCollection.

Instance memberIndexOf(item)

Returns the index of the specified item in the collection.

ParameterTypeDescription
itemListViewItemThe ListViewItem to locate in the collection.

Returns: Int32. The zero-based index of the item found in the ListViewItemCollection; otherwise, -1.

Instance memberIndexOfKey(key)

Returns the index of the first occurrence of a item with the specified key.

ParameterTypeDescription
keyStringThe name of the ListViewItem to search for.

Returns: Int32. The zero-based index of the first occurrence of a ListViewItem with the specified key, if found; otherwise, -1.

Instance memberInsert(index, item)

Inserts an existing item into the collection at the specified location.

ParameterTypeDescription
indexInt32The indexed location within the collection to insert the item.
itemListViewItemThe ListViewItemCollection to insert into the collection.

Throws:

Instance memberInsert(index, text)

Creates a new item with the specified text and inserts it at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the ListViewItem.
textStringThe text to display in the ListViewItem.

Returns: ListViewItem. The ListViewItem that was inserted in the collection.

Instance memberInsert(index, key, text)

Creates a new item with the specified text and key, and inserts it into the collection.

ParameterTypeDescription
indexInt32The location within the collection to insert the ListViewItem.
keyStringThe name of the ListViewItem.
textStringThe text to display in theListViewItem.

Returns: ListViewItem. The ListViewItem that was inserted in the collection.

Instance memberInsert(index, key, text, imageIndex)

Creates a new item with the specified key, text, and image, and inserts it into the collection at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the ListViewItem.
keyStringThe name of the ListViewItem.
textStringThe text to display in the ListViewItem.
imageIndexInt32The index of the image to display in the ListViewItem.

Returns: ListViewItem. The ListViewItem that was inserted in the collection.

Instance memberInsert(index, key, text, imageKey)

Creates a new item with the specified key, text, and image, and inserts it into the collection at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the ListViewItem.
keyStringThe name of the ListViewItem.
textStringThe text to display in the ListViewItem.
imageKeyStringThe key of the image to display in the ListViewItem.

Returns: ListViewItem. The ListViewItem that was inserted in the collection.

Instance memberRemove(item)

Removes the specified item from the collection.

ParameterTypeDescription
itemListViewItemThe ListViewItem to remove.

Instance memberRemoveAt(index)

Removes the item from the collection at a specified index.

ParameterTypeDescription
indexInt32The index of the ListViewItem to remove.

Instance memberRemoveByKey(key)

Removes the item with the specified key from the collection.

ParameterTypeDescription
keyStringThe name of the ListViewItem to remove from the collection.

Events

Instance memberCollectionChanged

CollectionChangeEventHandler Fired when the collection changes.