New to Telerik UI for Blazor? Start a free 30-day trial
Checkboxes in MultiSelect Dropdown
Updated on Jun 4, 2026
Environment
| Product | MultiSelect for Blazor |
Description
How to add checkboxes for item selection in the Telerik MultiSelect for Blazor? There should also be a "Select All" option at the top of the dropdown.
Solution
- Use an
ItemTemplateto add a Telerik Blazor CheckBox in each item. - Use a
HeaderTemplateto add a "Select All" checkbox above the data items. Optionally, use an indeterminate checkbox state if only some MultiSelect items are selected. - (optional) Set the MultiSelect
AutoCloseparameter tofalse. - (optional) Set the MultiSelect
TagModeparameter toSingleor alternatively, setMaxAllowedTagsto avoid drastic MultiSelect height changes when users select all items at once.
Using MultiSelect checkboxes in header and item templates
<TelerikMultiSelect @ref="@MultiSelectRef"
Data="@MultiSelectData"
@bind-Value="@MultiSelectValues"
AutoClose="false"
TextField="@nameof(ListItem.Text)"
ValueField="@nameof(ListItem.Id)"
ShowArrowButton="true"
TagMode="@MultiSelectTagMode.Multiple"
MaxAllowedTags="3">
<HeaderTemplate>
<label class="k-list-item">
<TelerikCheckBox Value="@(MultiSelectValues.Count == MultiSelectData.Count)"
ValueChanged="@SelectAllChanged"
TValue="@bool"
Indeterminate="@(MultiSelectValues.Count > 0 && MultiSelectValues.Count < MultiSelectData.Count)" />
<strong>Select All @MultiSelectData.Count Items</strong>
</label>
</HeaderTemplate>
<ItemTemplate>
<TelerikCheckBox Value="@MultiSelectValues.Contains(context.Id)" />
@context.Text
</ItemTemplate>
</TelerikMultiSelect>
@code {
#nullable enable
private TelerikMultiSelect<ListItem, int>? MultiSelectRef;
private List<ListItem> MultiSelectData { get; set; } = new();
private List<int> MultiSelectValues { get; set; } = new() { 1, 3 };
private void SelectAllChanged(bool value)
{
if (value)
{
MultiSelectValues = MultiSelectData.Select(i => i.Id).ToList();
}
else
{
MultiSelectValues = new();
}
MultiSelectRef?.Refresh();
}
protected override void OnInitialized()
{
MultiSelectData = new List<ListItem>();
for (int i = 1; i <= 24; i++)
{
MultiSelectData.Add(new ListItem()
{
Id = i,
Text = $"Item {i}",
Category = $"Category {i % 6 + 1}"
});
}
base.OnInitialized();
}
public class ListItem
{
public int Id { get; set; }
public string Text { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty;
}
}