Class DropDownListEvents<TValue, TItem>
Defines the SfDropDownList events of the component.
Inheritance
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class DropDownListEvents<TValue, TItem> : OwningComponentBase
Type Parameters
Name | Description |
---|---|
TValue | A type which provides for the Value poperty type. |
TItem | A type which provides data list schema for the dropdown list events. |
Constructors
DropDownListEvents()
Declaration
public DropDownListEvents()
Properties
BaseParent
Specifies the base parent of the component.
Declaration
protected SfDropDownList<TValue, TItem> BaseParent { get; set; }
Property Value
Type |
---|
SfDropDownList<TValue, TItem> |
Blur
Gets or sets the event callback that will be invoked when the dropdown list loses focus.
Declaration
public EventCallback<object> Blur { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
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> |
DataBound
Gets or sets the event callback that will be invoked when 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 filter textbox.
Declaration
public EventCallback<FilteringEventArgs> Filtering { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<FilteringEventArgs> |
Remarks
You can prevent the default filter action and make your query enable the PreventDefaultAction event argument, and pass the modify data source and query in FilterAsync(IEnumerable<TItem>, Query, FieldSettingsModel) method.
Examples
<SfDropDownList @ref="DDLObj" TItem="string" TValue="string" AllowFiltering="true" DataSource="@MyList">
<DropDownListEvents TValue="string" TItem="string" Filtering="@OnFilteringHandler" />
</SfDropDownList>
@code{
SfDropDownList<string, string> DDLObj { 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 DDLObj.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 evnet callback that will be invoked after data is fetched successfully 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> |
OnClose
Gets or sets the event callback that will be invoked before the dropdown popup is close.
Declaration
public EventCallback<PopupEventArgs> OnClose { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<PopupEventArgs> |
Remarks
You can prevent the dropdown popup close action using Cancel and the popup remains opened always.
Examples
<SfDropDownList TItem="string" TValue="string" DataSource="@MyList">
<DropDownListEvents TValue="string" TItem="string" OnClose="@OnCloseHandler"/>
</SfDropDownList>
@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
You can prevent the dropdown popup open action using Cancel.
Examples
<SfDropDownList TItem="string" TValue="string" DataSource="@MyList">
<DropDownListEvents TValue="string" TItem="string" OnOpen="@OnOpenHandler"/>
</SfDropDownList>
@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.");
}
}
OnResizing
Occurs while the popup is being resized.
Declaration
public EventCallback<object> OnResizing { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> | An Microsoft.AspNetCore.Components.EventCallback<> that receives an event argument object containing data during the resize process. |
Remarks
The OnResizing event provides continuous feedback during the resizing action, allowing you to monitor changes to the popup size in real-time. This event can be useful for enforcing constraints, adjusting layouts, or providing visual feedback as the popup is resized.
Examples
@code {
private void HandleResizing(object args) {
Console.WriteLine("Currently resizing...");
}
}
OnValueSelect
Gets or sets the event callback that will be when an item is selected from the dropdown popup by the user either with mouse/tap or with 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
<SfDropDownList TItem="string" TValue="string" DataSource="@MyList">
<DropDownListEvents TValue="string" TItem="string" OnValueSelect="@OnSelectHandler" />
</SfDropDownList>
@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> |
ValueChange
Gets or sets the event callback that will be invoked when the Value property changed.
Declaration
public EventCallback<ChangeEventArgs<TValue, TItem>> ValueChange { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ChangeEventArgs<TValue, TItem>> |
Remarks
This event triggers when an item in a popup is selected or when the model value is changed by user.
Examples
<SfDropDownList TItem="string" TValue="string" DataSource="@MyList">
<DropDownListEvents TValue="string" TItem="string" ValueChange="@OnChange"/>
</SfDropDownList>
@code{
protected List<string> MyList = new List<string>() { "Small", "Medium", "Large" };
public void OnChange(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, string> args) {
var DDLValue = args.Value;
}
}
Methods
ComponentDispose(Boolean)
Declaration
protected void ComponentDispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |