menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChipEvents - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChipEvents

    Configure handlers to handle the events with the Chip component.

    Inheritance
    System.Object
    ChipEvents
    Namespace: Syncfusion.Blazor.Buttons
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChipEvents : OwningComponentBase

    Constructors

    ChipEvents()

    Declaration
    public ChipEvents()

    Properties

    Created

    This created event will get triggered once the component rendering is completed.

    Declaration
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An event callback function.

    Deleted

    Gets or sets an event callback that is raised when the chip item is deleted.

    Declaration
    public EventCallback<ChipDeletedEventArgs> Deleted { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ChipDeletedEventArgs>

    An event callback function.

    Remarks

    You can get the deleted chip details.

    Examples

    In the below code example, the deleted chip value can be obtained from the Deleted event.

    <SfChip Selection="SelectionType.Multiple" EnableDelete=true>
        <ChipEvents Deleted="@onDeleted"></ChipEvents>
        <ChipItems>
            <ChipItem Text = "Small"></ChipItem>
            <ChipItem Text = "Medium"></ChipItem>
            <ChipItem Text = "Large"></ChipItem>
            <ChipItem Text = "Extra Large"></ChipItem>
        </ChipItems>
    </SfChip>
    @code {
        private void onDeleted(ChipDeletedEventArgs args) {
            string deletedValue = args.Value;
        }
    }

    Destroyed

    This created event will get triggered once the component successfuly disposed.

    Declaration
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An event callback function.

    OnBeforeClick

    This click event will get triggered once the chip is before click.

    Declaration
    public EventCallback<ChipEventArgs> OnBeforeClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ChipEventArgs>

    An event callback function.

    OnClick

    This click event will get triggered once the chip is clicked.

    Declaration
    public EventCallback<ChipEventArgs> OnClick { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ChipEventArgs>

    An event callback function.

    OnDelete

    This delete event will get triggered before removing the chip.

    Declaration
    public EventCallback<ChipEventArgs> OnDelete { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ChipEventArgs>

    An event callback function.

    SelectionChanged

    Gets or sets an event callback that is raised when the selected chips are changed.

    Declaration
    public EventCallback<SelectionChangedEventArgs> SelectionChanged { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<SelectionChangedEventArgs>

    An event callback function.

    Remarks

    You can get the updated SelectedChips value.

    Examples

    In the below code example, the SelectedChips value can be obtained from the SelectionChanged event.

    <SfChip Selection="SelectionType.Multiple">
        <ChipItems>
            <ChipItem Text = "Small"></ChipItem>
            <ChipItem Text = "Medium"></ChipItem>
            <ChipItem Text = "Large"></ChipItem>
            <ChipItem Text = "Extra Large"></ChipItem>
        </ChipItems>
      <ChipEvents SelectionChanged="SelectedChipsChanged" ></ChipEvents>
    </SfChip>
    @code {
        private void SelectedChipsChanged(SelectionChangedEventArgs args) {
           var selectedChipItems = args.AddedItems;
        }
    }

    Methods

    OnInitializedAsync()

    Method invoked when the component is ready to start.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    ="Task".

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved