Class ListBoxEvents<TValue, TItem>
Specifies a collection of events that are associated with the SfListBox<TValue, TItem>.
Inheritance
Namespace: Syncfusion.Blazor.DropDowns
Assembly: Syncfusion.Blazor.dll
Syntax
public class ListBoxEvents<TValue, TItem> : OwningComponentBase
Type Parameters
Name | Description |
---|---|
TValue | The type of the values that are used to identify items in the ListBox. |
TItem | The type of the items in the ListBox. |
Examples
The below code example, showcases a events.
<SfListBox @ref="ListBoxObj" Value="@value" DataSource="@vehicleData" TValue="string[]" TItem="ListItem">
<ListBoxFieldSettings Text="Text" Value="ID"></ListBoxFieldSettings>
<ListBoxEvents TValue="string[]" Created="created"></ListBoxEvents>
</SfListBox>
@code{
SfListBox<string[],ListItem> ListBoxObj;
private string[] value= new string[] { "List-01"};
private List<ListItem> vehicleData = new List<ListItem>{
new ListItem { Text = "Hennessey Venom", ID = "List-01"},
new ListItem { Text = "Bugatti Chiron", ID = "List-02"},
new ListItem { Text = "Bugatti Veyron Super Sport", ID = "List-03"}
}
public string[] Value = new string[] { "Bugatti Chiron" };
private async Task created(object args)
{
await ListBoxObj.SelectItemsAsync(Value, true);
}
public class ListItem
{
public string Text { get; set; }
public string ID { get; set; }
}
}
Constructors
ListBoxEvents()
Declaration
public ListBoxEvents()
Properties
Created
Gets or sets the event that fires when the SfListBox<TValue, TItem> component is created.
Declaration
public EventCallback<object> Created { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
Destroyed
Gets or sets the event that fires when the SfListBox<TValue, TItem> component is destroyed.
Declaration
public EventCallback<object> Destroyed { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
DragStart
Gets or sets the event callback that is raised before dragging the item in a SfListBox<TValue, TItem>.
Declaration
public EventCallback<DragEventArgs<TItem>> DragStart { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<DragEventArgs<TItem>> |
Remarks
This event will take into effect when the AllowDragAndDrop property is set to true
.
Dropped
Gets or sets the event that is raised after dropping the item on another SfListBox<TValue, TItem> item.
Declaration
public EventCallback<DropEventArgs<TItem>> Dropped { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<DropEventArgs<TItem>> |
Remarks
This event will take into effect when the AllowDragAndDrop property is set to true
.
Filtering
Gets or sets the event callback that is raised whenever the user entering text to filter the SfListBox<TValue, TItem> items.
Declaration
public EventCallback<FilteringEventArgs> Filtering { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<FilteringEventArgs> |
Remarks
This event will take into effect when the AllowFiltering property is set to true
.
ListBoxItemKeyDown
Gets or sets the event that is raised when performing keydown action in a list item.
Declaration
public EventCallback<ListBoxKeyDownEventArgs> ListBoxItemKeyDown { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ListBoxKeyDownEventArgs> |
OnActionBegin
Gets or sets the event callback that is triggered before fetching data from the remote server in the SfListBox<TValue, TItem>.
Declaration
public EventCallback<ActionBeginEventArgs> OnActionBegin { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ActionBeginEventArgs> |
OnActionComplete
Gets or sets the event callback that is triggered after fetching data from the remote server in the SfListBox<TValue, TItem>.
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 is triggered when the data fetch request from the remote server fails in the SfListBox<TValue, TItem>.
Declaration
public EventCallback<object> OnActionFailure { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<System.Object> |
OnDrop
Gets or sets the event callback that occurs before dropping the item on another SfListBox<TValue, TItem> item.
Declaration
public EventCallback<DropEventArgs<TItem>> OnDrop { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<DropEventArgs<TItem>> |
Remarks
This event will take into effect when the AllowDragAndDrop property is set to true
.
OnItemRender
Gets or sets the event callback that occurs before rendering every items in a SfListBox<TValue, TItem>.
Declaration
public EventCallback<BeforeItemRenderEventArgs<TItem>> OnItemRender { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<BeforeItemRenderEventArgs<TItem>> |
ValueChange
Gets or sets the event that occurs when the selected value of the SfListBox<TValue, TItem> changes.
Declaration
public EventCallback<ListBoxChangeEventArgs<TValue, TItem>> ValueChange { get; set; }
Property Value
Type |
---|
Microsoft.AspNetCore.Components.EventCallback<ListBoxChangeEventArgs<TValue, TItem>> |
Methods
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
OnInitializedAsync()
Declaration
protected override Task OnInitializedAsync()
Returns
Type |
---|
System.Threading.Tasks.Task |