# Templates

The MultiSelect provides full control over the rendering of items, selected values, and popup headers by using [Kendo UI templates](https://www.telerik.com/kendo-jquery-ui/documentation/framework/templates/overview).

For a complete example, refer to the [demo on customizing the MultiSelect templates](https://demos.telerik.com/kendo-ui/multiselect/template).

The MultiSelect supports the following templates:

* [Item templates](https://www.telerik.com/kendo-jquery-ui/documentation/controls/multiselect/templates#item-templates)
* [Tag templates](https://www.telerik.com/kendo-jquery-ui/documentation/controls/multiselect/templates#tag-templates)
* [Header templates](https://www.telerik.com/kendo-jquery-ui/documentation/controls/multiselect/templates#header-templates)
* [Footer templates](https://www.telerik.com/kendo-jquery-ui/documentation/controls/multiselect/templates#footer-templates)
* [No-data templates](https://www.telerik.com/kendo-jquery-ui/documentation/controls/multiselect/templates#no-data-templates)

## Item Templates

The item template manages the way the list items of a MultiSelect are rendered.

```
<select id="multiselect" multiple></select>

<script id="itemTemplate" type="text/x-kendo-template">
    ContactName: #:data.ContactName#, CustomerID: #:data.CustomerID#
</script>


<script>
    $(document).ready(function() {
        $("#multiselect").kendoMultiSelect({
            itemTemplate: $("#itemTemplate").html(),
            dataTextField: "ContactName",
            dataValueField: "CustomerID",
            dataSource: {
                transport: {
                    read: {
                        url: "https://demos.telerik.com/service/v2/core/Customers"
                    }
                }
            }
        });
    });
</script>
```

## Tag Templates

The tag template manages the way the tag of a MultiSelect is rendered.

```
<select id="multiselect" multiple></select>

<script id="tagTemplate" type="text/x-kendo-template">
    ContactName: #:data.ContactName#
</script>


<script>
    $(document).ready(function() {
        $("#multiselect").kendoMultiSelect({
            tagTemplate: $("#tagTemplate").html(),
            dataTextField: "ContactName",
            dataValueField: "CustomerID",
            dataSource: {
                transport: {
                    read: {
                        url: "https://demos.telerik.com/service/v2/core/Customers"
                    }
                }
            }
        });
    });
</script>
```

## Header Templates

The header template manages the way the popup header of a MultiSelect is rendered.

```
<select id="multiselect" />

<script id="headerTemplate" type="text/x-kendo-template">
    <strong>Header</strong>
</script>


<script>
    $(document).ready(function() {
        $("#multiselect").kendoMultiSelect({
            headerTemplate: $("#headerTemplate").html(),
            dataTextField: "ContactName",
            dataValueField: "CustomerID",
            dataSource: {
                transport: {
                    read: {
                        url: "https://demos.telerik.com/service/v2/core/Customers"
                    }
                }
            }
        });
    });
</script>
```

## Footer Templates

The footer template manages the way the pop-up footer of a MultiSelect is rendered. The footer is re-rendered on every change of the Data Source. The context of the template is the component itself.

```
<select id="multiselect" />

<script id="footerTemplate" type="text/x-kendo-template">
    Total <strong>#: instance.dataSource.total() #</strong> items found
</script>


<script>
    $(document).ready(function() {
        $("#multiselect").kendoMultiSelect({
            headerTemplate: $("#headerTemplate").html(),
            dataTextField: "ContactName",
            dataValueField: "CustomerID",
            dataSource: {
                transport: {
                    read: {
                        url: "https://demos.telerik.com/service/v2/core/Customers"
                    }
                }
            }
        });
    });
</script>
```

## No-Data Templates

The MultiSelect component displays `noDataTemplate` in the popup when the data source is empty.

> When the `noDataTemplate` option is defined, the MultiSelect always opens the popup element.

```
<select id="multiselect" />

<script id="noDataTemplate" type="text/x-kendo-template">
    <strong>No Data!</strong>
</script>


<script>
    $(document).ready(function() {
        $("#multiselect").kendoMultiSelect({
            noDataTemplate: $("#noDataTemplate").html(),
            dataTextField: "ContactName",
            dataValueField: "CustomerID",
            dataSource: {
                transport: {
                    read: {
                        url: "https://demos.telerik.com/service/v2/core/Customers"
                    }
                }
            }
        });
    });
</script>
```

## See Also

* [Customizing the Templates in the MultiSelect (Demo)](https://demos.telerik.com/kendo-ui/multiselect/template)
* [JavaScript API Reference of the MultiSelect](https://www.telerik.com/kendo-jquery-ui/documentation/api/ui/multiselect)
