# Events

This article describes the available events in the Telerik CheckBox component for Blazor.

* [IndeterminateChanged](https://www.telerik.com/blazor-ui/documentation/components/checkbox/events#indeterminatechanged)
* [OnBlur](https://www.telerik.com/blazor-ui/documentation/components/checkbox/events#onblur)
* [OnChange](https://www.telerik.com/blazor-ui/documentation/components/checkbox/events#onchange)
* [ValueChanged](https://www.telerik.com/blazor-ui/documentation/components/checkbox/events#valuechanged)

## IndeterminateChanged

The CheckBox fires its `IndeterminateChanged` event when the user clicks an [indeterminate CheckBox](https://www.telerik.com/blazor-ui/documentation/components/checkbox/indeterminate-state) and the `Indeterminate` parameter changes to `false`. From this point, only the app can restore the `Indeterminate` parameter value to `true`, which does not fire the `IndeterminateChanged` event.

> caption Using the CheckBox IndeterminateChanged event

<demo metaUrl="client/checkbox/indeterminate-changed/" height="420"></demo>

## OnBlur

The `OnBlur` event fires when the CheckBox loses focus.

> caption Using the CheckBox OnBlur event

<demo metaUrl="client/checkbox/on-blur/" height="300"></demo>

## OnChange

The `OnChange` event fires every time the `Value` parameter changes. The key differences with [`ValueChanged`](https://www.telerik.com/blazor-ui/documentation/components/checkbox/events#valuechanged) are:

* `OnChange` does not prevent two-way data binding for the `Value` parameter (`@bind-Value` syntax).
* `ValueChanged` always fires before `OnChange`.
* The `OnChange` event argument is an `object` that you need to cast. The `ValueChanged` event argument has the same type as `Value`.
* The `OnChange` event argument holds the current `Value`, while `ValueChanged` holds the new value that you must apply manually.

> caption Using the CheckBox OnChange event

<demo metaUrl="client/checkbox/on-change/" height="300"></demo>

## ValueChanged

The `ValueChanged` event fires every time the `Value` parameter changes. The event handler argument has the same type as the `Value` parameter. However, the handler always receives a `true` or `false` argument, even if the component is bound to a nullable boolean property. The new value depends on the old one as follows:

| Old Value | New Value |
| --------- | --------- |
| `true`    | `false`   |
| `false`   | `true`    |
| `null`    | `true`    |

Using the `ValueChanged` event requires one-way binding for the `Value` parameter and manual updating of the parameter in the handler. Compare with the [`OnChange` event](https://www.telerik.com/blazor-ui/documentation/components/checkbox/events#onchange).

You can use the `ValueChanged` handler to set a `null` `Value` programmatically and toggle between three possible values instead of two.

> caption Using the CheckBox ValueChanged event

<demo metaUrl="client/checkbox/value-changed/" height="400"></demo>

> tip The event is an `EventCallback`. It can be synchronous and return `void`, or asynchronous and return `async Task`. Do not use `async void`.

> note The lambda expression in the handler is required by the framework: <https://github.com/aspnet/AspNetCore/issues/12226>.

## See Also

* [ValueChanged and Validation](https://www.telerik.com/blazor-ui/documentation/knowledge-base/value-changed-validation-model)
