# ListView\.CheckedListViewItemCollection

Namespace: **Wisej.Web**

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

Represents the collection of checked items in a list view control.

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

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

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Constructors

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)CheckedListViewItemCollection(owner)

Initializes a new instance of the [CheckedListViewItemCollection](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview/wisej.web.listview.checkedlistviewitemcollection) class.

| Name      | Type                                                                           | Description                                                                                                        |
| --------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| **owner** | [ListView](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview) | A [ListView](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview) control that owns the collection. |

## Properties

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)Count

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

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)IsReadOnly

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

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)Item(index)

[ListViewItem](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview/wisej.web.listviewitem): Returns the item value at the specified index within the collection.

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) The *index* parameter is less than 0 or greater than or equal to the value of the [Count](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/wisej.web.listview.selectedlistviewitemcollection#count) property of [SelectedListViewItemCollection](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview/wisej.web.listview.selectedlistviewitemcollection).

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)Item(key)

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

## Methods

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)Contains(item)

Determines whether the specified item is located in the collection.

| Parameter | Type                                                                                                      | Description                                                                                                                                |
| --------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **item**  | [ListViewItem](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | The [ListViewItem](https://docs.wisej.com/api/v3.2/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 specified index from the [ListViewItemCollection](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview/wisej.web.listview.listviewitemcollection) for the [ListView](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview) is an item in the collection; otherwise, false.

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)ContainsKey(key)

Determines if an item with the specified key is contained in the collection.

| Parameter | Type                                                          | Description                         |
| --------- | ------------------------------------------------------------- | ----------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the item to search for. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if an item with the specified key is contained in the collection; otherwise, false.

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)GetEnumerator()

Returns an enumerator that can be used to iterate through the checked index 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 checked index collection.

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)IndexOf(item)

Returns the index within the [CheckedListViewItemCollection](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview/wisej.web.listview.checkedlistviewitemcollection) of the specified item.

| Parameter | Type                                                                                                      | Description                                                                                                                                |
| --------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| **item**  | [ListViewItem](https://docs.wisej.com/api/v3.2/wisej.web/lists-and-grids/listview/wisej.web.listviewitem) | The [ListViewItem](https://docs.wisej.com/api/v3.2/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 in the collection; otherwise, -1 if the item is not located in the collection.

### ![](https://3811934619-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaN9qL9rX9v301dsI6CfD%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media\&token=bc63f9cf-3241-48ac-8cb4-46d1df1d13df)IndexOfKey(key)

Determines the index of an item with the specified key.

| Parameter | Type                                                          | Description                                     |
| --------- | ------------------------------------------------------------- | ----------------------------------------------- |
| **key**   | [String](https://docs.microsoft.com/dotnet/api/system.string) | The name of the item to retrieve the index for. |

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