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 the event callback that will be invoked when the component loses focus.
Declaration
public EventCallback<object> Blur { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
ChipSelected
Gets or sets the event callback that will be invoked when a chip is selected in the MultiSelect component.
Declaration
public EventCallback<ChipSelectedEventArgs<TItem>> ChipSelected { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ChipSelectedEventArgs<TItem>> |
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" ChipSelected="@OnChipSelected" />
</SfMultiSelect>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnChipSelected(ChipSelectedEventArgs<string> args) {
var NewValue = args.ChipData;
}
}
Cleared
Gets or sets the event callback that will be 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 |
---|
Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.Web.MouseEventArgs> |
Closed
Gets or sets the event callback that will be invoked after the dropdown popup has been closed.
Declaration
public EventCallback<ClosedEventArgs> Closed { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ClosedEventArgs> |
Created
Gets or sets the event callback that will be invoked when the component is created.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
CustomValueSpecifier
Gets or sets the event callback that will be 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 |
---|
Microsoft.AspNetCore.Components.EventCallback<CustomValueEventArgs<TItem>> |
Examples
<SfMultiSelect TValue="int" TItem="Countries" DataSource="@CountryList">
<MultiSelectEvents TValue="int" TItem="Countries" CustomValueSpecifier="@customValue"/>
<MultiSelectFieldSettings Text="Name" Value="Code"/>
</SfMultiSelect>
@code{
public class Countries {
public string Name { get; set; }
public int Code { get; set; }
}
private List<Countries> CountryList = new List<Countries>() {
new Countries(){ Code= 101, Name= "Australia" },
new Countries(){ Code= 102, Name= "Canada" }
}
private void customValue(CustomValueEventArgs<Countries> args) {
args.NewData = new Countries() { Code = 103, Name = args.Text };
}
}
DataBound
Gets or sets the event callback that will be invoked when the data source is populated in the popup list.
Declaration
public EventCallback<DataBoundEventArgs> DataBound { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<DataBoundEventArgs> |
Destroyed
Gets or sets the event callback that will be invoked when the component is destroyed.
Declaration
public EventCallback<object> Destroyed { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
Filtering
Gets or sets the event callback that will be invoked on typing a character in the MultiSelect Dropdown search box.
Declaration
public EventCallback<FilteringEventArgs> Filtering { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<FilteringEventArgs> |
Remarks
Prevent the default filter action and make your query enable the PreventDefaultAction event argument, and pass the modified data source and query in the FilterAsync(IEnumerable<TItem>, Query, FieldSettingsModel) method.
Examples
<SfMultiSelect @ref="MultiSelectObj" TItem="string" TValue="string" AllowFiltering="true" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" Filtering="@OnFilteringHandler" />
</SfMultiSelect>
@code{
SfMultiSelect<string, string> MultiSelectObj { get; set; }
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public 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 the event callback that will be invoked when the component is the focus.
Declaration
public EventCallback<object> Focus { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
OnActionBegin
Gets or sets the event callback that will be invoked before fetching data from the data source.
Declaration
public EventCallback<ActionBeginEventArgs> OnActionBegin { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ActionBeginEventArgs> |
OnActionComplete
Gets or sets the event callback that will be invoked after data is fetched suction from the data source.
Declaration
public EventCallback<ActionCompleteEventArgs<TItem>> OnActionComplete { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ActionCompleteEventArgs<TItem>> |
OnActionFailure
Gets or sets the event callback that will be invoked when the data fetch request fails.
Declaration
public EventCallback<Exception> OnActionFailure { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Exception> |
OnChipTag
Gets or sets the event callback that will be invoked before setting the selected item as a chip in the MultiSelect Dropdown component.
Declaration
public EventCallback<TaggingEventArgs<TItem>> OnChipTag { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<TaggingEventArgs<TItem>> |
OnClose
Gets or sets the event callback that will be invoked before the dropdown popup is closed.
Declaration
public EventCallback<PopupEventArgs> OnClose { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs> |
Remarks
Prevent the dropdown popup close action using Cancel and the popup remains opened always.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnClose="@OnCloseHandler"/>
</SfMultiSelect>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnCloseHandler(PopupEventArgs args) {
args.Cancel = true;
}
}
OnOpen
Gets or sets the event callback that will be invoked when the dropdown popup before opens.
Declaration
public EventCallback<BeforeOpenEventArgs> OnOpen { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<BeforeOpenEventArgs> |
Remarks
Prevent the dropdown popup open action using Cancel.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnOpen="@OnOpenHandler"/>
</SfMultiSelect>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnOpenHandler(BeforeOpenEventArgs args) {
args.Cancel = true;
}
}
OnResizeStart
Occurs when the resizing action of the popup begins.
Declaration
public EventCallback<object> OnResizeStart { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An Microsoft.AspNetCore.Components.EventCallback<> that receives an event argument object containing resize start data. |
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
@code {
private void HandleResizeStart(object args) {
Console.WriteLine("Resizing has started.");
}
}
OnResizeStop
Occurs when the resizing action of the popup is completed.
Declaration
public EventCallback<object> OnResizeStop { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An Microsoft.AspNetCore.Components.EventCallback<> that receives an event argument object containing resize stop data. |
Remarks
Use the OnResizeStop event to perform custom actions after the user has finished resizing the popup. This event is ideal for finalizing layout adjustments, saving state, or logging the final size of the popup.
Examples
@code {
private void HandleResizeStop(object args) {
Console.WriteLine("Resizing has stopped.");
}
}
OnValueRemove
Gets or sets the event callback that will be invoked before the selected value is removed.
Declaration
public EventCallback<RemoveEventArgs<TItem>> OnValueRemove { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<RemoveEventArgs<TItem>> |
OnValueSelect
Gets or sets the event callback that will be invoked when an item is selected from the dropdown popup by the user either with a mouse tap or with a keyboard navigation.
Declaration
public EventCallback<SelectEventArgs<TItem>> OnValueSelect { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<SelectEventArgs<TItem>> |
Remarks
You can prevent the item selection action using Cancel.
Examples
<SfMultiSelect TItem="string" TValue="string" DataSource="@MyList">
<MultiSelectEvents TValue="string" TItem="string" OnValueSelect="@OnSelectHandler" />
</SfMultiSelect>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnSelectHandler(SelectEventArgs<string> args) {
if(args.ItemData== "Medium")
args.Cancel = true;
}
}
Opened
Gets or sets the event callback that will be invoked when the dropdown popup opens.
Declaration
public EventCallback<PopupEventArgs> Opened { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs> |
SelectedAll
Gets or sets the event callback that will be invoked after the select all process is completed in the MultiSelect Dropdown component.
Declaration
public EventCallback<SelectAllEventArgs<TItem>> SelectedAll { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<SelectAllEventArgs<TItem>> |
ValueChange
Gets or sets the event callback that will be invoked when the Value property changed.
Declaration
public EventCallback<MultiSelectChangeEventArgs<TValue>> ValueChange { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<MultiSelectChangeEventArgs<TValue>> |
Remarks
This event triggers when an item in a popup is selected 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{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnChange(MultiSelectChangeEventArgs<string> args) {
var NewValue = args.Value;
}
}
ValueRemoved
Gets or sets the event callback that will be invoked after the selected value has been removed.
Declaration
public EventCallback<RemoveEventArgs<TItem>> ValueRemoved { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<RemoveEventArgs<TItem>> |
Methods
ComponentDispose(Boolean)
Declaration
protected void ComponentDispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |