New to Telerik UI for Blazor? Start a free 30-day trial
Read-Only ListBox
Updated on Mar 25, 2026
Environment
| Product | ListBox for Blazor |
Description
I want to make the ListBox read-only. I am looking for a solution that doesn't allow users to modify the selected items or interact with the toolbar.
Solution
To achieve a read-only effect in the TelerikListBox, follow these steps:
- Use one-way binding for the
SelectedItemsparameter of the component. - Define a
SelectedItemsChangedevent handler, but avoid updating theSelectedItemsparameter in the handler. - Hide the ListBox toolbar by setting the
Visibleproperty of theListBoxToolBartofalse.
Here is an example:
<TelerikListBox Data="@ListBoxStrings"
SelectedItems="@ListBoxSelectedStrings"
SelectedItemsChanged="@((IEnumerable<string> list) => ListBoxSelectedStringsHandler(list))"
Height="auto">
<ListBoxToolBarSettings>
<ListBoxToolBar Visible="false" />
</ListBoxToolBarSettings>
</TelerikListBox>
@code {
private List<string> ListBoxStrings { get; set; } = new List<string>();
private IEnumerable<string> ListBoxSelectedStrings { get; set; } = new List<string>();
private void ListBoxSelectedStringsHandler(IEnumerable<string> list)
{
// You can execute custom logic here, but do not update ListBoxSelectedStrings
// to prevent the user from changing the selection.
}
protected override void OnInitialized()
{
for (int i = 1; i <= 7; i++)
{
ListBoxStrings.Add($"String {i}");
}
ListBoxSelectedStrings = new List<string> { "String 2", "String 5" };
}
}