How do I allow the addition of an item in a CheckBoxList?

I have a CheckBoxList that refreshes based on a drop down selection. I would like to add the ability for the user to add a new item to the CheckBoxList.

<RadzenCheckBoxList @bind-Value=@_coreFileValues Change=@(args => CoreFilesChanged(args)) Data="@(_coreFiles.Where(o => o.CoreId == _coreId))" Orientation="Orientation.Vertical" TValue="string" TextProperty="Name" ValueProperty="Name" />

int _coreId;

public string? SelectedCoreFiles { get; set; }
IEnumerable _coreFileValues = new string[] { };

protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
_coreFiles = await CoreFileService.GetCoreFilesForForm();
}

void CoreChanged(object value)
{
if (_import != null)
_import.CoreId = (int)value;
}

void CoreFilesChanged(IEnumerable<string> value)
{
    SelectedCoreFiles = string.Join(",", value);
}

Hi @fr33kyd33ky,

RadzenCheckBoxList does not have a built-in UI that allows adding new options. You need to implement that yourself and update the _coreFiles field.

@korchev Do you have an example of how to do that?