Skip to main content

DxTagBox<TData, TValue>.SelectedItemsChanged Event

Fires after the selection changes.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public EventCallback<IEnumerable<TData>> SelectedItemsChanged { get; set; }

Parameters

Type Description
IEnumerable<T>

A collection of selected items.

Remarks

Handle the SelectedItemsChanged event to respond to item selection changes. This event fires in the following cases:

  • When users change item selection.
  • When Values property is changed in code. This also includes the first render.
<DxTagBox Data="@Staff.DataSource" @bind-Values="@Values"
          TextFieldName="@nameof(Person.Text)" 
          SelectedItemsChanged="@((IEnumerable<Person> values) => SelectedItemsChanged(values))">
</DxTagBox>

<p>@msg</p>

@code {
    string msg;

    IEnumerable<int> Values { get; set; } = Staff.DataSource.Take(12).Select(t => t.Id);

    void SelectedItemsChanged(IEnumerable<Person> values) {
        msg = values.First().FirstName + " " + values.First().LastName + " is selected";
    }
}

Selected TagBox item changed

See Also