Library Blazor Components ListBox Reference Classes ListBox ItemTemplate

ItemTemplate

A template used for rendering of every item from ItemsSource.

razor
[Parameter]
public IEnumerable<T>? ItemsSource { get; set; }

Example

razor
<ListBox T="Country" ItemsSource="Countries" @bind-SelectedItem="Selected">
    <ItemTemplate>
        <img src="images/@context.FlagFile" height="16" /><span>@context.Title</span>
    </ItemTemplate>
</ListBox>

Sign in