DropDown Multiple Select - "Unable to cast object of type 'System.Linq.EnumerableQuery' to type 'System.String'."

I'm having an issue with the DropDown component throwing the error in the title whenever I select a dropdown item. Here's my code:

<RadzenCard>
    <h4 class="mb-4">Select Employee(s):</h4>
    <RadzenDropDown AllowClear="true" Name="emp" TValue="string"
        FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
        FilterOperator="StringFilterOperator.Contains"
        AllowFiltering="true"
        Data=@allEmployees.Keys.ToList()
        Placeholder="Begin Typing to Search..."
        Multiple="true"
        Value=@selectedEmployeeList />
</RadzenCard>

along with the associated CS code:

private Dictionary<string, int> allEmployees;
private IEnumerable<string> selectedEmployeeList;
protected override void OnInitialized(){
        // populate the allEmployees Dictionary with employee names and IDs from SQL DB
}

The DropDown component successfully displays all of the existing employees, as well as the check marks next to their names for selection, but whenever I select a check box, I get the error stated in the title. I've gone through the documentation and done the correct binding. I'm choosing not to use the dbcontext since dbcontext object interactions are not thread-safe.

You should not use expressions in Data property since in this case the component will be rebound continuously and no state can be kept. Here is an example from our DropDown demo page similar to your case:

Hi Vladimir, I implemented the change you suggested, but the error is still happening.

If you have Radzen Professional subscription you can use info@radzen.com to send us your application to check it.

Sadly I do not. I was hoping this minimum required reproducible code would help.

Update: fixed it - had to cast the return type from the component as 'object', then call .ToString() on it. It's jank but it works for now.

I had a similar issue and it was because the dataset had some Null strings in the field I was filtering. I defaulted them all to empty strings and it resolved it.