menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ListBoxChangeEventArgs<TValue, TItem> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ListBoxChangeEventArgs<TValue, TItem>

    Provides the event data for the ValueChange event of the SfListBox<TValue, TItem> component.

    Inheritance
    System.Object
    ListBoxChangeEventArgs<TValue, TItem>
    Namespace: Syncfusion.Blazor.DropDowns
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ListBoxChangeEventArgs<TValue, TItem> : Object
    Type Parameters
    Name Description
    TValue

    The type of the value parameter.

    TItem

    The type of the item parameter.

    Remarks

    This class is used as the parameter in the ValueChange event callback. It allows you to read the currently selected values and bound items during a value change event.

    Examples

    The following example demonstrates how to use ListBoxChangeEventArgs<TValue, TItem> to handle value changes.

    <SfListBox TValue="string" TItem="Employee" @bind-Value="selectedEmployeeIds" ValueChange="OnValueChange">
    </SfListBox>
    
    private void OnValueChange(ListBoxChangeEventArgs<string, Employee> args)
    {
        // Access args.Value and args.Items
    }

    Constructors

    ListBoxChangeEventArgs()

    Declaration
    public ListBoxChangeEventArgs()

    Properties

    Items

    Gets or sets the list of items currently bound to the SfListBox<TValue, TItem> component.

    Declaration
    public IEnumerable<TItem> Items { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<TItem>

    An System.Collections.Generic.IEnumerable<> that represents the collection of items displayed in the ListBox. The default value is null.

    Remarks

    Use this property to access the available data at the time of the ValueChange event.

    Examples
    var items = args.Items;

    Value

    Gets or sets the selected values from the SfListBox<TValue, TItem>.

    Declaration
    public TValue Value { get; set; }
    Property Value
    Type Description
    TValue

    A TValue that represents the selected value(s) of the ListBox. The default value is null.

    Remarks

    This property reflects the currently selected item(s) during value changes, supporting single or multi-selection depending on component configuration.

    Examples
    string firstSelected = args.Value;
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved