Object reference null when selecting items in Radzen Dropdown

Since upgrading from 3.18.4 to 4.10.2, I have started to get a null reference error whenever I try and change the value of my multiselect dropdown. This also then seems to impact the rest of the fields on the form (text boxes and checkboxes) which also then throw the same error if I try and interact with them. If I try and use the text box or checkbox before using the dropdown the error does not occur.

This is what my form looks like (checkboxes redacted for brevity):

<RadzenTemplateForm TItem="AspectDto" Data=@aspectDto Submit=@OnValidSubmit>
    <DataAnnotationsValidator />
    <fieldset disabled="@Disabled">
        <div class="row">
            <div class="col-12 col-md-6 col-lg-4">
                <label id="name-label">Name</label>
            </div>
            <div class="col-12 col-md-6 col-lg-4">
                <RadzenTextArea @bind-Value="aspectDto.Name" aria-describedby="name-label" class="w-100" />
                <ValidationMessage For="@(() => aspectDto.Name)" />
            </div>
        </div>
        <hr />
        <div class="row form-group mb-3">
            <div class="col-12 col-md-6 col-lg-4">
                <label id="linked-form-types-label">Linked Form Types</label>
            </div>
            <div class="col-12 col-md-6 col-lg-4">
                <RadzenDropDown AllowClear="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" AllowFiltering="true"
                                @bind-Value=@aspectDto.SelectedFormTypes Data=@formTypesDto TextProperty="Name" ValueProperty="Id"
                                Placeholder="Please Select" Multiple="true" aria-describedby="linked-form-types-label" class="w-100" />
            </div>
        </div>
        <hr />
        <div class="row form-group mb-3">
            <div class="col-12 col-md-6 col-lg-4">
                <label id="grade=set-label">Grade Set</label>
            </div>
            <div class="col-12 col-md-6 col-lg-4">
                <RadzenDropDown @bind-Value=@aspectDto.GradeSetId Data=@gradeSetsDto TextProperty="Name" ValueProperty="Id"
                                Placeholder="Please Select" aria-describedby="grade-set-label" class="w-100" />
            </div>
        </div>
        <hr />
        <div class="row">
            <div class="col-12 col-md-6 col-lg-4">
                <label id="guidance-label">Guidance</label>
            </div>
            <div class="col-12 col-md-6 col-lg-8">
                <RadzenHtmlEditor @bind-Value="aspectDto.Guidance" aria-describedby="guidance-label" class="w-100" />
            </div>
        </div>
        
    </fieldset>
    <div class="row">
        <div class="col-12 col-md-6 col-lg-4 btn-group mb-4">
            @if (!Disabled)
            {
                <button type="submit" class="btn btn-primary">
                    @ButtonText
                </button>
            }
            <a href="/admin/quality-assurance/aspects" class="btn btn-secondary">
                @ReturnText
            </a>
        </div>
    </div>
    </RadzenTemplateForm>

and in the backend code:

        private IList<GradeSetDto>? gradeSetsDto;

        private IList<FormTypeDto>? formTypesDto;

        protected async override Task OnInitializedAsync()
        {
            _interceptor.MonitorEvent();
            gradeSetsDto = await _client.GetFromJsonAsync<List<GradeSetDto>>("api/Admin/QualityAssurance/GetGradeSets");
            formTypesDto = await _client.GetFromJsonAsync<List<FormTypeDto>>("api/Admin/QualityAssurance/GetFormTypes");
        }

The full error I'm getting is:

Blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at System.Linq.Dynamic.Core.Parser.KeywordsHelper..ctor(ParsingConfig config)
   at System.Linq.Dynamic.Core.Parser.ExpressionParser..ctor(ParameterExpression[] parameters, String expression, Object[] values, ParsingConfig parsingConfig)
   at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(Type delegateType, ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
   at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, ParameterExpression[] parameters, Type resultType, String expression, Object[] values)
   at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda(ParsingConfig parsingConfig, Boolean createParameterCtor, Type itType, Type resultType, String expression, Object[] values)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where(IQueryable source, ParsingConfig config, String predicate, Object[] args)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[Object](IQueryable`1 source, ParsingConfig config, String predicate, Object[] args)
   at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[Object](IQueryable`1 source, String predicate, Object[] args)
   at Radzen.DropDownBase`1[[System.Collections.Generic.IEnumerable`1[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].SelectItemFromValue(Object value)
   at Radzen.DropDownBase`1[[System.Collections.Generic.IEnumerable`1[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].OnParametersSetAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.CallOnParametersSetAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.SetParametersAsync(ParameterView parameters)
   at Radzen.RadzenComponent.<>n__0(ParameterView parameters)
   at Radzen.RadzenComponent.SetParametersAsync(ParameterView parameters)
   at Radzen.DataBoundFormComponent`1.<SetParametersAsync>d__75[[System.Collections.Generic.IEnumerable`1[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Radzen.DropDownBase`1.<SetParametersAsync>d__105[[System.Collections.Generic.IEnumerable`1[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Radzen.Blazor.RadzenDropDown`1.<SetParametersAsync>d__42[[System.Collections.Generic.IEnumerable`1[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
u

What am I doing wrong?

According to the exception you wither have null items in your collection or there isn't Id property. You can use the debugger to verify this.
.

Hi @enchev

I've checked the debugger and my collection both has items and they have IDs...

Unfortunately I’m not sure in this case. If you have Radzen / Radzen Blazor Studio active subscription you can send us at info@radzen.com the application where we can reproduce and debug the exception.

Hi @enchev, I need to convince my company to buy a licence but I will try and debug it myself in the meantime. I've tried replacing the data with a very simple list of ints instead and that no longer errors when I select or deselect items, but if I allow filtering and try and filter the list, it errors again. Is this likely to be a bug within Radzen?

I’m afraid I can’t comment since I’m unable to reproduce such exception.

Okay, fair enough. I'll see what I can do about a licence. For what it's worth, I'm using .NET 7 and this was never an issue before when I tried Radzen with .NET 6.