Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxListBox<TData, TValue>.ValuesChanged Event

Fires after a collection of selected values changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<IEnumerable<TValue>> ValuesChanged { get; set; }

#Parameters

Type Description
IEnumerable<TValue>

A collection of selected values.

#Remarks

The ValuesChanged event event fires in the following cases:

The ValuesChanged event is handled automatically when you use two-way data binding for the Values property (@bind-Values).

@using Data

<DxListBox Data="@Staff.DataSource"
           TextFieldName="@nameof(Person.Text)"
           Values="@Values"
           ValuesChanged="@((IEnumerable<Person> values) => ValuesChanged(values))">
</DxListBox>

@code {
    IEnumerable<Person> Values { get; set; }

    void ValuesChanged(IEnumerable<Person> values) {
        Values = values;
        InvokeAsync(StateHasChanged);
    }
}

If your List Box supports single selection, handle the ValueChanged event instead.

You can validate the List Box’s Values if the component is in the standard EditForm. When you validate user input in the ValuesChanged event handler and cannot use two-way data binding, use the ValuesExpression property to identify the value passed to the event.

See Also