# ListView\.ListViewItemCollection

Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.0.0.0)

Represents the collection of items in a [ListView](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview) control.

{% tabs %}
{% tab title="C#" %}

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

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class ListViewItemCollection
    Inherits IList
    Implements ICollection, IEnumerable, IList(Of ListViewItem), ICollection(Of ListViewItem), IEnumerable(Of ListViewItem)
```

{% endtab %}
{% endtabs %}

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Count

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the total number of items in the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IsReadOnly

[Boolean](https://docs.microsoft.com/dotnet/api/system.boolean): Returns a value indicating whether the collection is read-only.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Item(index)

[ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem): Returns or sets the item at the specified index in the collection.

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception)\
  The *index* value is less than 0 or is greater than the number of items in the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Item(key)

[ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem): Returns the item with the specified key from the collection.

## Methods

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(text)

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

| Parameter | Type                                                          | Description                                                                                                                           |
| --------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The label text displayed by the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). A [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that represents the item being added to the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(key, text)

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

| Parameter | Type                                                          | Description                                                                                                                      |
| --------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).            |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that was added to the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(key, text, imageIndex)

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

| Parameter      | Type                                                          | Description                                                                                                                                    |
| -------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **key**        | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                          |
| **text**       | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).               |
| **imageIndex** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | The index of the image to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that was added to the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(key, text, imageKey)

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

| Parameter    | Type                                                          | Description                                                                                                                       |
| ------------ | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **key**      | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the item.                                                                                                             |
| **text**     | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).  |
| **imageKey** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The image to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that was added to the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(item)

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

| Parameter | Type                                                                                                 | Description                                                                                                                        |
| --------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to add to the collection. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The zero-based index value of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) added to the collection.

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The *item* is currently assigned to another [ListView](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) AddRange(items)

Adds an array of previously created items to the collection.

| Parameter | Type                                                                                                     | Description                                                                                                                                                               |
| --------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **items** | [ListViewItem\[\]](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | An array of [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) objects representing the items to add to the collection. |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception)*items* is null.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)*items* is the child of another [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Clear()

Removes all items from the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Clear(dispose)

Removes all items from the collection and optionally disposes them.

| Parameter   | Type                                                            | Description                                             |
| ----------- | --------------------------------------------------------------- | ------------------------------------------------------- |
| **dispose** | [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean) | Indicates whether the removed items should be disposed. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Contains(item)

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

| Parameter | Type                                                                                                 | Description                                                                                                                           |
| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to locate in the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) is a member of the collection; otherwise, false.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) ContainsKey(key)

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

| Parameter | Type                                                          | Description                                                                                                                         |
| --------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to search for. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true to indicate the collection contains a [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) with the specified key; otherwise, false.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CopyTo(dest, index)

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

| Parameter | Type                                                        | Description                                                 |
| --------- | ----------------------------------------------------------- | ----------------------------------------------------------- |
| **dest**  | [Array](https://docs.microsoft.com/dotnet/api/system.array) | The destination array.                                      |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index in the destination array at which storing begins. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) GetEnumerator()

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

**Returns:** [IEnumerator\<ListViewItem>](https://docs.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1). An [IEnumerator](https://docs.microsoft.com/dotnet/api/system.collections.ienumerator) that represents the [ListViewItemCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listview.listviewitemcollection).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IndexOf(item)

Returns the index of the specified item in the collection.

| Parameter | Type                                                                                                 | Description                                                                                                                           |
| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| **item**  | [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to locate in the collection. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The zero-based index of the item found in the [ListViewItemCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listview.listviewitemcollection); otherwise, -1.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) IndexOfKey(key)

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

| Parameter | Type                                                          | Description                                                                                                                         |
| --------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to search for. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The zero-based index of the first occurrence of a [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) with the specified key, if found; otherwise, -1.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Insert(index, item)

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

| Parameter | Type                                                                                                 | Description                                                                                                                                                          |
| --------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                                          | The indexed location within the collection to insert the item.                                                                                                       |
| **item**  | [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | The [ListViewItemCollection](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listview.listviewitemcollection) to insert into the collection. |

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)\
  The *item* is currently assigned to another [ListView](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Insert(index, text)

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

| Parameter | Type                                                          | Description                                                                                                                                            |
| --------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | The location within the collection to insert the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                       |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that was inserted in the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Insert(index, key, text)

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

| Parameter | Type                                                          | Description                                                                                                                                            |
| --------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | The location within the collection to insert the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                                  |
| **text**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display in the[ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                        |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that was inserted in the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Insert(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.

| Parameter      | Type                                                          | Description                                                                                                                                            |
| -------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **index**      | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | The location within the collection to insert the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |
| **key**        | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                                  |
| **text**       | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                       |
| **imageIndex** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | The index of the image to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).         |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that was inserted in the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Insert(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.

| Parameter    | Type                                                          | Description                                                                                                                                            |
| ------------ | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **index**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)   | The location within the collection to insert the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). |
| **key**      | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                                  |
| **text**     | [String](https://docs.microsoft.com/dotnet/api/system.string) | The text to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).                       |
| **imageKey** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The key of the image to display in the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem).           |

**Returns:** [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem). The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) that was inserted in the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) OnCollectionChanged(action, element)

Fires the [CollectionChanged](#collectionchanged) event.

| Parameter   | Type                                                                                                         | Description                                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **action**  | [CollectionChangeAction](https://docs.microsoft.com/dotnet/api/system.componentmodel.collectionchangeaction) | One of [CollectionChangeAction](https://docs.microsoft.com/dotnet/api/system.componentmodel.collectionchangeaction) indicating the reason the collection has changed. |
| **element** | [Object](https://docs.microsoft.com/dotnet/api/system.object)                                                | The element that was added or removed from the collection, or null.                                                                                                   |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Remove(item)

Removes the specified item from the collection.

| Parameter | Type                                                                                                 | Description                                                                                                         |
| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| **item**  | [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | The [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to remove. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) RemoveAt(index)

Removes the item from the collection at a specified index.

| Parameter | Type                                                        | Description                                                                                                                      |
| --------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to remove. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) RemoveByKey(key)

Removes the item with the specified key from the collection.

| Parameter | Type                                                          | Description                                                                                                                                         |
| --------- | ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the [ListViewItem](https://docs.wisej.com/api/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) to remove from the collection. |

## Events

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) CollectionChanged

[CollectionChangeEventHandler](https://docs.microsoft.com/dotnet/api/system.componentmodel.collectionchangeeventhandler) Fired when the collection changes.
