I'm trying to track all "checked" items in a list box. However, my property that maintains the values only contains the last item that was checked instead of all items checked. Using the below code, whenever multiple items are checked, the SelectedColumnIdsCurrent array never increases past 1 element.
<SfListBox DataSource="ColumnsCurrent"TItem="ViewColumn"TValue="Guid[]" @bind-Value="SelectedColumnIdsCurrent">
<ListBoxSelectionSettings ShowCheckbox="true"/>
<ListBoxFieldSettings Text="Header"Value="Id"/>
</SfListBox>
@SelectedColumnIdsCurrent.Length
@code {
public class ViewColumn
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Header => Name;
}
IList ColumnsCurrent { get; set; } = new List()
{
new ViewColumn() { Id = Guid.NewGuid(), Name="Column A" },
new ViewColumn() { Id = Guid.NewGuid(), Name="Column B" },
new ViewColumn() { Id = Guid.NewGuid(), Name="Column C" },
new ViewColumn() { Id = Guid.NewGuid(), Name="Column D" },
new ViewColumn() { Id = Guid.NewGuid(), Name="Column E" },
};
Guid[] SelectedColumnIdsCurrent = new Guid[0];
}