Class
TelerikMultiSelect<TItem, TValue>

The class for the Telerik MultiSelect component.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Type Parameters:

TItem

TValue

Syntax:

cs-api-definition
public class TelerikMultiSelect<TItem, TValue> : TelerikSelectBase<TItem, List<TValue>>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IPopupContainer

Inheritance: objectComponentBaseBaseComponentDataBoundComponent<TItem>TelerikSelectBase<TItem, List<TValue>>TelerikMultiSelect<TItem, TValue>

Implements: IComponentIDisposableIHandleAfterRenderIHandleEventIPopupContainer

Inherited Members TelerikSelectBase<TItem, List<TValue>>.OnParametersSetAsync()TelerikSelectBase<TItem, List<TValue>>.OnInitializedAsync()TelerikSelectBase<TItem, List<TValue>>.Dispose()TelerikSelectBase<TItem, List<TValue>>.FocusAsync()TelerikSelectBase<TItem, List<TValue>>.Open()TelerikSelectBase<TItem, List<TValue>>.Close()TelerikSelectBase<TItem, List<TValue>>.Refresh()TelerikSelectBase<TItem, List<TValue>>.DebounceChangeValue(string)TelerikSelectBase<TItem, List<TValue>>.CascadedEditContextTelerikSelectBase<TItem, List<TValue>>.FloatingLabelTelerikSelectBase<TItem, List<TValue>>.IdTelerikSelectBase<TItem, List<TValue>>.ValueFieldTelerikSelectBase<TItem, List<TValue>>.TextFieldTelerikSelectBase<TItem, List<TValue>>.GroupFieldTelerikSelectBase<TItem, List<TValue>>.HeaderTemplateTelerikSelectBase<TItem, List<TValue>>.FooterTemplateTelerikSelectBase<TItem, List<TValue>>.NoDataTemplateTelerikSelectBase<TItem, List<TValue>>.WidthTelerikSelectBase<TItem, List<TValue>>.FilterableTelerikSelectBase<TItem, List<TValue>>.TitleTelerikSelectBase<TItem, List<TValue>>.SubtitleTelerikSelectBase<TItem, List<TValue>>.AriaLabelTelerikSelectBase<TItem, List<TValue>>.AriaLabelledByTelerikSelectBase<TItem, List<TValue>>.AriaDescribedByTelerikSelectBase<TItem, List<TValue>>.ReadOnlyTelerikSelectBase<TItem, List<TValue>>.InputModeTelerikSelectBase<TItem, List<TValue>>.ScrollModeTelerikSelectBase<TItem, List<TValue>>.ItemHeightTelerikSelectBase<TItem, List<TValue>>.PageSizeTelerikSelectBase<TItem, List<TValue>>.EnabledTelerikSelectBase<TItem, List<TValue>>.ValueExpressionTelerikSelectBase<TItem, List<TValue>>.ValueChangedTelerikSelectBase<TItem, List<TValue>>.ValueTelerikSelectBase<TItem, List<TValue>>.TabIndexTelerikSelectBase<TItem, List<TValue>>.AdaptiveModeTelerikSelectBase<TItem, List<TValue>>.OnChangeTelerikSelectBase<TItem, List<TValue>>.OnBlurTelerikSelectBase<TItem, List<TValue>>.FillModeTelerikSelectBase<TItem, List<TValue>>.RoundedTelerikSelectBase<TItem, List<TValue>>.SizeTelerikSelectBase<TItem, List<TValue>>.ProcessingDataDataBoundComponent<TItem>.SetParametersAsync(ParameterView)DataBoundComponent<TItem>.Dispose()DataBoundComponent<TItem>.Rebind()DataBoundComponent<TItem>.DataBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSet()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)

Constructors

TelerikMultiSelect()

Declaration

cs-api-definition
public TelerikMultiSelect()

Properties

AllowCustom

Enables users to enter and select custom text values that don't exist in the predefined data source. When true, users can type any text and add it as a selection even if it's not in the dropdown list. Only works with string-based value types - use when TValue is string for proper type safety. REQUIREMENT: ValueField must point to a string property when enabled. UX: Essential for scenarios where users need flexibility beyond predefined options like tags or categories.

Declaration

cs-api-definition
[Parameter]
public bool AllowCustom { get; set; }

Property Value

bool

AriaDescribedBy

Defines the ARIA describedby attribute to establish relationships between the MultiSelect and external descriptive content. Default behavior automatically references the internal selected tag list for screen reader accessibility. Override to reference custom help text, instructions, or error messages that describe the component's purpose or state. ACCESSIBILITY: Critical for screen readers to understand component context and provide meaningful descriptions to users. RESPONSIBILITY: When overriding, ensure the referenced element exists and provides valuable context for assistive technologies.

Declaration

cs-api-definition
[Parameter]
public override string AriaDescribedBy { get; set; }

Property Value

string

Overrides TelerikSelectBase<TItem, List<TValue>>.AriaDescribedBy

AutoClose

Controls whether the dropdown list automatically closes after users select an item. When true (default), dropdown closes after each selection for quick single-item workflows. When false, dropdown remains open for efficient multiple item selection without repeated opening. WORKFLOW: Disable for bulk selection scenarios where users need to pick many items quickly. MOBILE: Consider mobile UX when keeping dropdown open - may obscure other interface elements.

Declaration

cs-api-definition
[Parameter]
public bool AutoClose { get; set; }

Property Value

bool

DebounceDelay

Sets the delay in milliseconds between when users stop typing and when the filtering operation triggers. Prevents excessive filtering calls while users are actively typing by waiting for a pause in input. Default value is 150ms, balancing responsive feedback with performance optimization. PERFORMANCE: Higher values reduce server requests but may feel less responsive to users. UX: Lower values provide immediate feedback but may cause performance issues with large datasets or slow connections.

Declaration

cs-api-definition
[Parameter]
public int DebounceDelay { get; set; }

Property Value

int

FilterOperator

Defines how text filtering matches user input against data item text values. StartsWith matches items beginning with the typed text (default). Contains matches items containing the typed text anywhere within them. EndsWith matches items ending with the typed text. PERFORMANCE: StartsWith filtering is typically faster than Contains for large datasets. UX: Contains filtering provides more flexible search but may return too many results with short input.

Declaration

cs-api-definition
[Parameter]
public StringFilterOperator FilterOperator { get; set; }

Property Value

StringFilterOperator

ItemTemplate

Customizes how individual items appear in the dropdown list using Razor markup templates. Children: allows arbitrary content including HTML, Blazor components, icons, badges, and interactive elements. Receives the current data item as context parameter, enabling dynamic content based on item properties. Use for rich item presentation with images, multi-line content, status indicators, or custom formatting. PERFORMANCE: Keep templates lightweight as they render for every visible item during scrolling.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<TItem> ItemTemplate { get; set; }

Property Value

RenderFragment<TItem>

LoaderShowDelay

Sets the delay in milliseconds before showing the loading indicator when data is being fetched. Prevents flickering loading states for fast data operations while providing feedback for longer operations. Default value is 300ms, balancing immediate feedback with visual stability for typical data loading scenarios. PERFORMANCE: Higher values reduce loading indicator flicker but may leave users without feedback during longer loads. UX: Adjust based on typical data loading times - shorter for local data, longer for network operations.

Declaration

cs-api-definition
[Parameter]
public int LoaderShowDelay { get; set; }

Property Value

int

MaxAllowedTags

Limits how many individual item tags are shown before switching to a summary display format. When selections exceed this number, additional items are consolidated into a summary tag showing the count. Prevents interface overcrowding when many items are selected while maintaining visibility of primary selections. RELATIONSHIP: Works with TagMode and SummaryTagTemplate to control display behavior. UX: Set based on available space and importance of seeing individual vs. aggregate selection information.

Declaration

cs-api-definition
[Parameter]
public int? MaxAllowedTags { get; set; }

Property Value

int?

MinLength

Sets the minimum number of characters users must type before the dropdown list appears with filtering suggestions. Helps prevent overwhelming users with large datasets by requiring more specific input before showing options. Default value is 0, meaning the dropdown opens immediately when users start typing or click in the input. PERFORMANCE: Higher values reduce server requests and improve performance with large remote datasets. UX: Balance between immediate feedback (low values) and focused results (higher values) based on data size.

Declaration

cs-api-definition
[Parameter]
public int MinLength { get; set; }

Property Value

int

MultiSelectPrefixTemplate

Defines custom content displayed before the selected item tags and input field. Children: allows arbitrary content including icons, labels, search controls, or branding elements. Content appears at the leftmost position inside the MultiSelect input container. Use for context indicators, category labels, or functional elements that enhance the selection experience. LAYOUT: Prefix content pushes tags and input field to the right within the available container width.

Declaration

cs-api-definition
[Parameter]
public RenderFragment MultiSelectPrefixTemplate { get; set; }

Property Value

RenderFragment

MultiSelectSettings

Contains configuration settings for the MultiSelect dropdown popup behavior and appearance. Children: MultiSelectPopupSettings component with properties for positioning, animation, and responsive behavior. Use to customize popup dimensions, positioning logic, animation effects, and mobile-specific adaptations. MOBILE: Settings control how dropdown adapts to mobile devices, potentially switching to action sheet presentation. POSITIONING: Configure popup placement relative to the input, collision detection, and viewport boundaries.

Declaration

cs-api-definition
[Parameter]
public RenderFragment MultiSelectSettings { get; set; }

Property Value

RenderFragment

MultiSelectSuffixTemplate

Defines custom content displayed after the selected item tags and input field. Children: allows arbitrary content including action buttons, status indicators, or supplementary controls. Content appears at the rightmost position inside the MultiSelect input container before the clear/arrow buttons. Use for validation indicators, help buttons, or functional elements that complement the selection process. LAYOUT: Suffix content is positioned between the input area and built-in control buttons.

Declaration

cs-api-definition
[Parameter]
public RenderFragment MultiSelectSuffixTemplate { get; set; }

Property Value

RenderFragment

OnClose

Fires before the dropdown list closes, allowing customization or prevention of the closing action. Use for validation checks, data persistence, or cleanup operations before the dropdown becomes hidden. Event args support cancellation to prevent closing based on conditions like unsaved changes or required selections. TIMING: Occurs before dropdown animation starts, enabling smooth user experience with proper state management. ASYNC: Supports asynchronous operations for validation or data persistence before closing.

Declaration

cs-api-definition
[Parameter]
public EventCallback<MultiSelectCloseEventArgs> OnClose { get; set; }

Property Value

EventCallback<MultiSelectCloseEventArgs>

OnItemRender

Fires each time a dropdown item is rendered, allowing customization of individual item appearance and styling. Use to conditionally apply CSS classes, modify item presentation, or highlight specific items based on their data. Event provides access to the current item's data and allows setting custom CSS classes for visual differentiation. PERFORMANCE: Keep logic lightweight as this fires for every visible item during rendering and scrolling. STYLING: Ideal for status indicators, priority highlighting, or conditional formatting based on item properties.

Declaration

cs-api-definition
[Parameter]
public Action<MultiSelectItemRenderEventArgs<TItem>> OnItemRender { get; set; }

Property Value

Action<MultiSelectItemRenderEventArgs<TItem>>

OnOpen

Fires before the dropdown list opens, allowing customization or prevention of the opening action. Use for dynamic data loading, permission checks, or UI state preparation before users see dropdown options. Event args support cancellation to prevent opening based on conditions like loading states or validation. TIMING: Occurs before dropdown animation starts, enabling smooth user experience with proper preparation. ASYNC: Supports asynchronous operations for data preparation or validation checks.

Declaration

cs-api-definition
[Parameter]
public EventCallback<MultiSelectOpenEventArgs> OnOpen { get; set; }

Property Value

EventCallback<MultiSelectOpenEventArgs>

OnRead

Fires when the component needs to retrieve data, enabling custom data loading and server-side operations. Use this event to implement filtering, paging, sorting, or loading data from external sources like APIs. Once attached, you take full control of data operations - the component will no longer perform automatic filtering. REQUIREMENT: When used with virtual scrolling, implement ValueMapper for proper pre-selection of unloaded items. PERFORMANCE: Essential for handling large datasets efficiently through server-side processing.

Declaration

cs-api-definition
[Parameter]
public EventCallback<MultiSelectReadEventArgs> OnRead { get; set; }

Property Value

EventCallback<MultiSelectReadEventArgs>

PersistFilterOnSelect

Controls whether the user's filter text remains in the input field after selecting an item from the dropdown. When true, preserves the typed filter text for continued filtering and selection of additional items. When false, clears the filter text after each selection to reset the view to all available options. REQUIREMENT: Only effective when filtering is enabled and AutoClose is set to false. UX: Enable for power users who want to make multiple selections from filtered results efficiently.

Declaration

cs-api-definition
[Parameter]
public bool PersistFilterOnSelect { get; set; }

Property Value

bool

Placeholder

Sets the placeholder text displayed when no items are selected and the input field is empty. Provides helpful guidance about what users should select or how they should interact with the component. Placeholder disappears when focus is received or when any items are selected to avoid visual clutter. ACCESSIBILITY: Placeholder text should not be the only way to convey required information - use proper labels. UX: Keep placeholder text short and actionable like "Choose options" or "Select categories".

Declaration

cs-api-definition
[Parameter]
public string Placeholder { get; set; }

Property Value

string

ShowArrowButton

Controls whether a dropdown arrow button appears at the right side of the input, providing visual indication of dropdown functionality. When visible, users can click the arrow to open/close the dropdown list in addition to clicking in the input area. Arrow provides clear visual cue that the component has dropdown behavior, especially important for accessibility and discoverability. Default value is false - enable when you want explicit dropdown button for enhanced usability. MOBILE: Arrow buttons are more touch-friendly on mobile devices than input area clicks.

Declaration

cs-api-definition
[Parameter]
public bool ShowArrowButton { get; set; }

Property Value

bool

ShowClearButton

Controls whether a clear button (X) appears when items are selected, allowing users to remove all selections at once. Button appears on hover or focus when the MultiSelect contains selected values, positioned in the input area. When clicked, removes all selected items and resets the component to its empty state. Default value is true to provide easy bulk deselection functionality for better user experience. ACCESSIBILITY: Clear button is keyboard accessible and announces its purpose to screen readers.

Declaration

cs-api-definition
[Parameter]
public bool ShowClearButton { get; set; }

Property Value

bool

ShowPrefixSeparator

Controls whether a visual separator line appears after the prefix content. When true, displays a vertical divider between MultiSelectPrefixTemplate and the main input area. Helps visually distinguish prefix content from the interactive selection area for better user experience. Default value is true to maintain clear visual boundaries between content sections. DESIGN: Separator uses theme-appropriate styling to match the overall component appearance.

Declaration

cs-api-definition
[Parameter]
public bool ShowPrefixSeparator { get; set; }

Property Value

bool

ShowSuffixSeparator

Controls whether a visual separator line appears before the suffix content. When true, displays a vertical divider between the main input area and MultiSelectSuffixTemplate. Helps visually distinguish the interactive selection area from suffix content for better user experience. Default value is true to maintain clear visual boundaries between content sections. DESIGN: Separator uses theme-appropriate styling to match the overall component appearance.

Declaration

cs-api-definition
[Parameter]
public bool ShowSuffixSeparator { get; set; }

Property Value

bool

SummaryTagTemplate

Customizes how the summary tag appears when multiple items are condensed into a single tag display. Children: allows arbitrary content with access to summary context including selected items and count information. Template receives MultiSelectSummaryTagTemplateContext<TItem> providing selected items and aggregate data. Use for custom count displays, item previews, or summary information that helps users understand their selections. TRIGGER: Displays when TagMode is Single or when selections exceed MaxAllowedTags in Multiple mode.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<MultiSelectSummaryTagTemplateContext<TItem>> SummaryTagTemplate { get; set; }

Property Value

RenderFragment<MultiSelectSummaryTagTemplateContext<TItem>>

TagMode

Controls how selected items are displayed as visual tags within the input area. Multiple displays each selected item as an individual removable tag. Single shows all selections condensed into one summary tag with count. RELATIONSHIP: Works with MaxAllowedTags to determine when to switch between individual and summary display. UX: Multiple mode provides item-level control, Single mode saves space with large selections.

Declaration

cs-api-definition
[Parameter]
public MultiSelectTagMode TagMode { get; set; }

Property Value

MultiSelectTagMode

TagTemplate

Customizes how selected items appear as individual tags (chips) within the input area using Razor markup. Children: allows arbitrary content including HTML, components, icons, and interactive elements for each selected item. Receives the selected data item as context parameter, enabling dynamic tag content based on item properties. Use for rich tag presentation with colors, icons, status indicators, or abbreviated text for space efficiency. RELATIONSHIP: Only applies when TagMode is Multiple for individual tags.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<TItem> TagTemplate { get; set; }

Property Value

RenderFragment<TItem>

TextField

Defines the property name from data items to display as the visible text in dropdown options and selected tags. Must match a public property name on TItem objects that returns the display text. Works in combination with ValueField to separate what users see from what gets selected. Default value is "Text" which works with simple string collections or objects having a Text property. BINDING: Essential for displaying meaningful labels when working with complex objects or ID-based selections.

Declaration

cs-api-definition
[Parameter]
public override string TextField { get; set; }

Property Value

string

Overrides TelerikSelectBase<TItem, List<TValue>>.TextField

ValueMapper

Provides a callback function that retrieves full data items corresponding to selected values, essential for virtual scrolling scenarios. Used when OnRead is implemented and selected values may reference items not currently loaded in the viewport. Function receives list of selected values and must return the corresponding complete data items for proper display. REQUIREMENT: Required when combining OnRead with virtual scrolling to enable pre-selection of unloaded items. ASYNC: Supports asynchronous operations for fetching item details from remote sources or databases.

Declaration

cs-api-definition
[Parameter]
public Func<List<TValue>, Task<List<TItem>>> ValueMapper { get; set; }

Property Value

Func<List<TValue>, Task<List<TItem>>>

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

OnAfterRenderAsync(bool)

Declaration

cs-api-definition
protected override Task OnAfterRenderAsync(bool firstRender)

Parameters

firstRender

bool

Returns

Task

Overrides BaseComponent.OnAfterRenderAsync(bool)

OnParametersSetAsync()

Declaration

cs-api-definition
protected override Task OnParametersSetAsync()

Returns

Task

Overrides TelerikSelectBase<TItem, List<TValue>>.OnParametersSetAsync()