# CheckedListBox.CheckedIndexCollection

Namespace: **Wisej.Web**

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

Represents the collection containing the indexes to the selected items in a [CheckedListBox](https://docs.wisej.com/api/wisej.web/lists-and-grids/checkedlistbox).

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

```csharp
public class CheckedIndexCollection : IList, ICollection, IEnumerable
```

{% endtab %}

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

```visual-basic
Public Class CheckedIndexCollection
    Inherits IList
    Implements ICollection, IEnumerable
```

{% 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 number of selected items.

### ![](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 this collection can be modified.

### ![](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)

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns the index of a checked item in the [CheckedListBox](https://docs.wisej.com/api/wisej.web/lists-and-grids/checkedlistbox) control.

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The *index* is less than zero.-or- The *index* is not in 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) Contains(index)

Determines if the specified index is located within the collection.

| Parameter | Type                                                        | Description                            |
| --------- | ----------------------------------------------------------- | -------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index to locate in the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). true if the index is located within 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) CopyTo(array, index)

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

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

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *array* is null.
* [RankException](https://docs.microsoft.com/dotnet/api/system.rankexception) *array* is multidimensional.
* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) *index* is less than zero.
* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The number of elements in the source [Array](https://docs.microsoft.com/dotnet/api/system.array) is greater than the available space from index to the end of the destination [Array](https://docs.microsoft.com/dotnet/api/system.array).
* [ArrayTypeMismatchException](https://docs.microsoft.com/dotnet/api/system.arraytypemismatchexception) The type of the source [Array](https://docs.microsoft.com/dotnet/api/system.array) cannot be cast automatically to the type of the destination [Array](https://docs.microsoft.com/dotnet/api/system.array).

### ![](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 [CheckedIndices](https://docs.wisej.com/api/wisej.web/lists-and-grids/checkedlistbox/..#checkedindices) collection.

**Returns:** [IEnumerator](https://docs.microsoft.com/dotnet/api/system.collections.ienumerator). An [IEnumerator](https://docs.microsoft.com/dotnet/api/system.collections.ienumerator) for navigating through the list.

### ![](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(index)

Returns an index into the collection of checked indexes.

| Parameter | Type                                                        | Description                    |
| --------- | ----------------------------------------------------------- | ------------------------------ |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The index of the checked item. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The index that specifies the index of the checked item or -1 if the *index* parameter is not in the checked indexes collection.
