> For the complete documentation index, see [llms.txt](https://docs.wisej.com/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/checkedlistbox/wisej.web.checkedlistbox.objectcollection.md).

# CheckedListBox.ObjectCollection

Namespace: **Wisej.Web**

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

* [ObjectCollection](/api/v3.1/wisej.web/lists-and-grids/listbox/wisej.web.listbox.objectcollection.md)
  * [ObjectCollection](/api/v3.1/wisej.web/lists-and-grids/checkedlistbox/wisej.web.checkedlistbox.objectcollection.md)

Represents the collection of items in a [CheckedListBox](/api/v3.1/wisej.web/lists-and-grids/checkedlistbox.md).

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

```csharp
public class ObjectCollection : ObjectCollection
```

{% endtab %}

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

```visual-basic
Public Class ObjectCollection
    Inherits ObjectCollection
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/QmRDluociuQ34KzBtOjf)Add(item)

Adds an item to the list of items for a [ListBox](/api/v3.1/wisej.web/lists-and-grids/listbox.md).

| Parameter | Type                                                                | Description                                               |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------- |
| **item**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | An object representing the item to add to the collection. |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32). The zero-based index of the item in the collection.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) The *item* parameter was null.

### ![](/files/QmRDluociuQ34KzBtOjf)Add(item, isChecked)

Adds an item to the list of items for a [CheckedListBox](/api/v3.1/wisej.web/lists-and-grids/checkedlistbox.md).

| Parameter     | Type                                                                  | Description                                               |
| ------------- | --------------------------------------------------------------------- | --------------------------------------------------------- |
| **item**      | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)   | An object representing the item to add to the collection. |
| **isChecked** | [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean) | True to check the item.                                   |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32). The zero-based index of the item in the collection.

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) The *item* parameter was null.

### ![](/files/QmRDluociuQ34KzBtOjf)Add(item, check)

Adds an item to the list of items for a [CheckedListBox](/api/v3.1/wisej.web/lists-and-grids/checkedlistbox.md).

| Parameter | Type                                                                   | Description                                               |
| --------- | ---------------------------------------------------------------------- | --------------------------------------------------------- |
| **item**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)    | An object representing the item to add to the collection. |
| **check** | [CheckState](/api/v3.1/wisej.web/enumerations/wisej.web.checkstate.md) | The check state for the new item.                         |

**Returns:** [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32).

### ![](/files/QmRDluociuQ34KzBtOjf)AddRange(items)

Adds a collection of items to the list.

| Parameter | Type                                                                    | Description                             |
| --------- | ----------------------------------------------------------------------- | --------------------------------------- |
| **items** | [Object\[\]](https://docs.microsoft.com/en-us/dotnet/api/system.object) | Collection of items to add to the list. |

### ![](/files/QmRDluociuQ34KzBtOjf)Clear()

Removes all items from the [CheckedListBox](/api/v3.1/wisej.web/lists-and-grids/checkedlistbox.md) control.

### ![](/files/QmRDluociuQ34KzBtOjf)Insert(index, item)

Inserts an item into the collection at the specified index.

| Parameter | Type                                                                | Description                                               |
| --------- | ------------------------------------------------------------------- | --------------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)   | The zero-based index location where the item is inserted. |
| **item**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) | An object representing the item to insert.                |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) The *item* was null.
* [ArgumentOutOfRangeException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentoutofrangeexception) The *index* was less than zero; or the *index* was greater than the count of items in the collection.

### ![](/files/QmRDluociuQ34KzBtOjf)Insert(index, item, check)

Inserts an item into the collection at the specified index.

| Parameter | Type                                                                   | Description                                               |
| --------- | ---------------------------------------------------------------------- | --------------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)      | The zero-based index location where the item is inserted. |
| **item**  | [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object)    | An object representing the item to insert.                |
| **check** | [CheckState](/api/v3.1/wisej.web/enumerations/wisej.web.checkstate.md) | The check state for the new item.                         |

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentnullexception) The *item* was null.
* [ArgumentOutOfRangeException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentoutofrangeexception) The *index* was less than zero; or the *index* was greater than the count of items in the collection.

### ![](/files/QmRDluociuQ34KzBtOjf)RemoveAt(index)

Removes an item from the [ListBox](/api/v3.1/wisej.web/lists-and-grids/listbox.md) at the specified index.

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

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/en-us/dotnet/api/system.argumentoutofrangeexception) The *index* parameter was less than zero, or the *index* parameter was greater than or equal to the count of items in the collection.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wisej.com/api/v3.1/wisej.web/lists-and-grids/checkedlistbox/wisej.web.checkedlistbox.objectcollection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
