# JavaScript.ClientEventCollection

Namespace: **Wisej.Web**

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

Represents a collection of JavaScript events and their corresponding handler code.

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

```csharp
public class ClientEventCollection : IList, ICollection, IEnumerable, IList<ClientEvent>, ICollection<ClientEvent>, IEnumerable<ClientEvent>
```

{% endtab %}

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

```visual-basic
Public Class ClientEventCollection
    Inherits IList
    Implements ICollection, IEnumerable, IList(Of ClientEvent), ICollection(Of ClientEvent), IEnumerable(Of ClientEvent)
```

{% endtab %}
{% endtabs %}

## Constructors

### ![](/files/hsR4ok3152WyAf8J2C1u) ClientEventCollection()

Initializes a new instance of [ClientEventCollection](/api/wisej.web/general/control/wisej.web.javascript.clienteventcollection.md).

## Properties

### ![](/files/hsR4ok3152WyAf8J2C1u) Count

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

### ![](/files/hsR4ok3152WyAf8J2C1u) Item(index)

[ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent): Returns the [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) element at the specified *index* .

## Methods

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

Adds the [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) instance to the collection.

| Parameter | Type                                                              | Description                                                                                      |
| --------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| **item**  | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) item to add to the collection. |

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

Removes all the [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) items from the collection.

### ![](/files/hsR4ok3152WyAf8J2C1u) Contains(item)

Checks whether the specified *item* exists in the collection.

| Parameter | Type                                                              | Description                                                                                        |
| --------- | ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **item**  | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) items to find in the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True of the collection contains the specified *item* .

### ![](/files/hsR4ok3152WyAf8J2C1u) IndexOf(item)

Returns the position of the specified *item* in the collection.

| Parameter | Type                                                              | Description                                                                                         |
| --------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| **item**  | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) item to locate in the collection. |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The index of the specified *item* or -1 if not found.

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

Inserts the *item* into the collection at the specified *index* .

| Parameter | Type                                                              | Description                                                                                           |
| --------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)       | Position where to insert the *item* .                                                                 |
| **item**  | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) item to insert into the collection. |

### ![](/files/hsR4ok3152WyAf8J2C1u) Remove(item)

Removes the *item* from the collection.

| Parameter | Type                                                              | Description                                                                                               |
| --------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| **item**  | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) | [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) instance to remove from the collection. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True of the specified *item* was found and removed from the collection.

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

Removes the [ClientEvent](/api/wisej.web/extenders/javascript.md#clientevent) item at the location *index* .

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

## Events

### ![](/files/hsR4ok3152WyAf8J2C1u) CollectionChanged

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


---

# Agent Instructions: 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:

```
GET https://docs.wisej.com/api/wisej.web/general/control/wisej.web.javascript.clienteventcollection.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
