Class MultiSelectEvents<TValue, TItem>
Represents the event handlers for a MultiSelect Dropdown component.
Inheritance
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class MultiSelectEvents<TValue, TItem> : OwningComponentBase
Type Parameters
Name | Description |
---|---|
TValue | Specifies the value type. |
TItem | Specifies the type of MultiSelectEvents. |
Constructors
MultiSelectEvents()
Declaration
public MultiSelectEvents()
Properties
Blur
Gets or sets an event callback that is invoked when the MultiSelect Dropdown component loses focus.
Declaration
public EventCallback<object> Blur { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An |
Remarks
Use this event to perform operations when the MultiSelect loses focus, such as validation triggers or UI state changes.
ChipSelected
Gets or sets an event callback that is invoked when a chip is selected in the MultiSelect Dropdown component.
Declaration
public EventCallback<ChipSelectedEventArgs<TItem>> ChipSelected { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ChipSelectedEventArgs<TItem>> | An |
Remarks
Use this event to determine which chip has been selected by the user.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" ChipSelected="@OnChipSelected"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnChipSelected(ChipSelectedEventArgs<string> args) {
// New chip value is args.ChipData
}
}
Cleared
Gets or sets an event callback invoked after all items have been cleared using the clear icon in the MultiSelect Dropdown component.
Declaration
public EventCallback<MouseEventArgs> Cleared { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs> | An |
Remarks
Use this event for post-processing after all MultiSelect values are cleared.
Closed
Gets or sets an event callback invoked after the dropdown popup has been closed for the MultiSelect Dropdown component.
Declaration
public EventCallback<ClosedEventArgs> Closed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ClosedEventArgs> | An |
Remarks
Use this event to adjust related UI or perform operations post-close.
Created
Gets or sets an event callback invoked when the MultiSelect Dropdown component is created.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An |
Remarks
Use this event for logic dependent on component creation or to access references.
CustomValueSpecifier
Gets or sets an event callback that is invoked when custom values, not present in the data source, are selected in the MultiSelect Dropdown component.
Declaration
public EventCallback<CustomValueEventArgs<TItem>> CustomValueSpecifier { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<CustomValueEventArgs<TItem>> | An |
Remarks
Allows the component to handle values that are not in the provided data source.
Examples
<SfMultiSelect TValue="int" TItem="Countries" DataSource="@CountryList">
<MultiSelectEvents TValue="int" TItem="Countries" CustomValueSpecifier="@customValue"/>
<MultiSelectFieldSettings Text="Name" Value="Code"/>
</SfMultiSelect>
@code {
private List<Countries> CountryList = new List<Countries>();
public class Countries {
public string Name { get; set; }
public int Code { get; set; }
}
void customValue(CustomValueEventArgs<Countries> args) {
args.NewData = new Countries() { Code = 103, Name = args.Text };
}
}
DataBound
Gets or sets an event callback that is invoked after the data source is populated in the popup list for the MultiSelect Dropdown component.
Declaration
public EventCallback<DataBoundEventArgs> DataBound { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<DataBoundEventArgs> | An |
Remarks
Use this event for post-processing or side-effects based on the data bound to the popup list.
Destroyed
Gets or sets an event callback invoked when the MultiSelect Dropdown component is destroyed.
Declaration
public EventCallback<object> Destroyed { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An |
Remarks
Use this event to perform cleanup tasks or unsubscribe from services.
Filtering
Gets or sets an event callback invoked whenever a character is typed in the MultiSelect Dropdown search box.
Declaration
public EventCallback<FilteringEventArgs> Filtering { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<FilteringEventArgs> | An |
Remarks
Prevent the default filter action and enable your own query by setting the FilteringEventArgs.PreventDefaultAction
property.
You can then pass a modified data source and query to FilterAsync(IEnumerable<TItem>, Query, FieldSettingsModel) method for custom filtering.
Examples
<SfMultiSelect @ref="MultiSelectObj" TItem="string" TValue="string" AllowFiltering="true" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" Filtering="@OnFilteringHandler" />
</SfMultiSelect>
@code {
private SfMultiSelect<string, string> MultiSelectObj;
private List<string> MyList = new List<string>();
async Task OnFilteringHandler(FilteringEventArgs args) {
args.PreventDefaultAction = true;
var query = new Query().Where(new WhereFilter() { Field = "Text", Operator = "contains", value = args.Text, IgnoreCase = true });
await MultiSelectObj.FilterAsync(MyList, query);
}
}
Focus
Gets or sets an event callback invoked when the MultiSelect Dropdown component receives focus.
Declaration
public EventCallback<object> Focus { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An |
Remarks
Use this event for validation, input guidance, or UI enhancement when the MultiSelect receives focus.
OnActionBegin
Gets or sets an event callback that is invoked before fetching data from the data source in the MultiSelect Dropdown component.
Declaration
public EventCallback<ActionBeginEventArgs> OnActionBegin { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ActionBeginEventArgs> | An |
Remarks
Use the OnActionBegin event to perform custom logic or cancel the upcoming data operation.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnActionBegin="@OnActionBeginHandler"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnActionBeginHandler(ActionBeginEventArgs args) {
// Custom logic
}
}
OnActionComplete
Gets or sets an event callback that is invoked after data is fetched from the data source in the MultiSelect Dropdown component.
Declaration
public EventCallback<ActionCompleteEventArgs<TItem>> OnActionComplete { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<ActionCompleteEventArgs<TItem>> | An |
Remarks
Use the OnActionComplete event for post-processing on fetched data.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnActionComplete="@OnActionCompleteHandler"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnActionCompleteHandler(ActionCompleteEventArgs<string> args) {
// Custom post-fetch logic
}
}
OnActionFailure
Gets or sets an event callback that is invoked when the data fetch request fails for the MultiSelect Dropdown component.
Declaration
public EventCallback<Exception> OnActionFailure { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Exception> | An |
Remarks
Use the OnActionFailure event to handle data retrieval errors for the MultiSelect Dropdown component.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnActionFailure="@OnFailureHandler"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnFailureHandler(Exception ex) {
// Log error
}
}
OnChipTag
Gets or sets an event callback invoked before the selected item is set as a chip in the MultiSelect Dropdown component.
Declaration
public EventCallback<TaggingEventArgs<TItem>> OnChipTag { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<TaggingEventArgs<TItem>> | An |
Remarks
Use this event to modify the way items are displayed as chips on selection.
OnClose
Gets or sets an event callback that is invoked before the dropdown popup closes in the MultiSelect Dropdown component.
Declaration
public EventCallback<PopupEventArgs> OnClose { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs> | An |
Remarks
Prevent the dropdown popup close action using PopupEventArgs.Cancel
. If cancelled, the popup remains open.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnClose="@OnCloseHandler"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnCloseHandler(PopupEventArgs args) {
args.Cancel = true;
}
}
OnOpen
Gets or sets an event callback invoked before the dropdown popup opens in the MultiSelect Dropdown component.
Declaration
public EventCallback<BeforeOpenEventArgs> OnOpen { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<BeforeOpenEventArgs> | An |
Remarks
Prevent the popup open action using BeforeOpenEventArgs.Cancel
property.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnOpen="@OnOpenHandler"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnOpenHandler(BeforeOpenEventArgs args) {
args.Cancel = true;
}
}
OnResizeStart
Gets or sets an event callback that is raised when the resizing action of the popup begins in the MultiSelect Dropdown component.
Declaration
public EventCallback<object> OnResizeStart { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An |
Remarks
Use the OnResizeStart event to perform custom actions when the user initiates resizing of the popup. This event can be useful for setting initial states, logging, or displaying messages when resizing starts.
Examples
<SfMultiSelect TValue="string[]" AllowResize="true">
<MultiSelectEvents OnResizeStart="HandleResizeStart" />
</SfMultiSelect>
@code {
private void HandleResizeStart(object args) {
Console.WriteLine("Resizing has started.");
}
}
OnResizeStop
Gets or sets an event callback that is raised when resizing action of the popup is completed in the MultiSelect Dropdown component.
Declaration
public EventCallback<object> OnResizeStop { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An |
Remarks
Use the OnResizeStop event to perform custom actions after the user finishes resizing the popup. This event is ideal for finalizing layout, saving state, or logging the popup's final size.
Examples
<SfMultiSelect TValue="string[]" AllowResize="true">
<MultiSelectEvents OnResizeStop="HandleResizeStop" />
</SfMultiSelect>
@code {
private void HandleResizeStop(object args) {
Console.WriteLine("Resizing has stopped.");
}
}
OnValueRemove
Gets or sets an event callback invoked before a value is removed from selection in the MultiSelect Dropdown component.
Declaration
public EventCallback<RemoveEventArgs<TItem>> OnValueRemove { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RemoveEventArgs<TItem>> | An |
Remarks
Use this event to conditionally filter which values can be removed from selection.
OnValueSelect
Gets or sets an event callback invoked when a user selects an item from the dropdown popup in the MultiSelect Dropdown component.
Declaration
public EventCallback<SelectEventArgs<TItem>> OnValueSelect { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SelectEventArgs<TItem>> | An |
Remarks
You can prevent the item selection action using SelectEventArgs<TItem>.Cancel
.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnValueSelect="@OnSelectHandler"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnSelectHandler(SelectEventArgs<string> args) {
if (args.ItemData == "Medium")
args.Cancel = true;
}
}
Opened
Gets or sets an event callback invoked when the dropdown popup is opened for the MultiSelect Dropdown component.
Declaration
public EventCallback<PopupEventArgs> Opened { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs> | An |
Remarks
Use for logging, state control, or to trigger UI effects during popup open.
SelectedAll
Gets or sets an event callback invoked after executing the select all operation in the MultiSelect Dropdown component.
Declaration
public EventCallback<SelectAllEventArgs<TItem>> SelectedAll { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<SelectAllEventArgs<TItem>> | An |
Remarks
Use this event to respond to select all operations for MultiSelect lists.
SelectingAll
Gets or sets the event callback that will be invoked before the select all process is start in the MultiSelect Dropdown component.
Declaration
public EventCallback<SelectingAllEventArgs<TItem>> SelectingAll { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<SelectingAllEventArgs<TItem>> |
Remarks
To cancel the Select All
action, set Cancel.
You can prevent the OnValueSelect
, OnValueRemove
, and ValueRemoved
events using SuppressItemEvents.
Examples
<SfMultiSelect TValue="string" TItem="string" DataSource="@MyList" Mode="CheckBox" SelectingAll="OnSelectingAll">
</SfMultiSelect>
@code {
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnSelectingAll(SelectingAllEventArgs<string> args) {
// You can write the logic here
}
}
ValueChange
Gets or sets an event callback that is invoked when the Value property changes, either by selection or user model update.
Declaration
public EventCallback<MultiSelectChangeEventArgs<TValue>> ValueChange { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<MultiSelectChangeEventArgs<TValue>> | An |
Remarks
This event triggers when an item is selected in the popup or when the model value is changed by the user.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" ValueChange="@OnChange"/>
</SfMultiSelect>
@code {
private List<string> MyList = new List<string>();
public void OnChange(MultiSelectChangeEventArgs<string> args) {
// New value is args.Value
}
}
ValueRemoved
Gets or sets an event callback invoked after a value has been removed from selection in the MultiSelect Dropdown component.
Declaration
public EventCallback<RemoveEventArgs<TItem>> ValueRemoved { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<RemoveEventArgs<TItem>> | An |
Remarks
Use this event to respond to value removals, such as updates to external lists or counters.
Methods
ComponentDispose(Boolean)
Declaration
protected void ComponentDispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |