# Selecting All Checkboxes in the MultiSelect

## Environment

<table>
    <tbody>
	    <tr>
	    	<td>Product</td>
	    	<td>Progress® Kendo UI for Angular MultiSelect</td>
	    </tr>
    </tbody>
</table>

## Description

How can I select all items in the [MultiSelect](https://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect) component.

## Solution

Add a custom select-all checkbox at the top of the list using the [header template](https://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/templates#header-template) of the MultiSelect component.

```html
    <ng-template kendoMultiSelectHeaderTemplate>
        <input
            type="checkbox"
            id="chk"
            kendoCheckBox
            [checked]="isChecked"
            [indeterminate]="isIndet"
            (click)="onClick()"
        />
        <kendo-label for="chk">Select all</kendo-label>
    </ng-template>
```

To select or deselect all options, manually update the MultiSelect value.

```ts
    public onClick() {
        this.isChecked = !this.isChecked;
        this.value = this.isChecked ? this.listItems.slice() : [];
    }
```

To update the **Select all** checkbox state:

1. Control the `checked` state of the checkbox by using the [`checked`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#htmlattrdef#checked) property.
2. Control the `indeterminate` state of the checkbox by using the [`indeterminate`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#htmlattrdef#indeterminate) property.

The following example demonstrates the full implementation of the suggested approach.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/knowledge-base/select-all-multiselect/source.txt)
