Skip to main content

DxListBox<TData, TValue>.ValuesChanged Event

Fires after a collection of selected values changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v22.1.dll

Declaration

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

Parameters

Type Description
IEnumerable<TValue>

A collection of selected values.

Remarks

The ValuesChanged event fires each time the Values collection changes.

@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