RadzenDataGridColumn NullReferenceException if parameter SortOrder of column is bound to NULL #183

Closed
opened 2026-01-29 17:32:57 +00:00 by claunia · 0 comments
Owner

Originally created by @Mastaleck on GitHub (Aug 24, 2021).

If the SortOrder parameter of a RadzenDataGridColumn is bound to a field of type SortOrder? and the value is set to NULL during runtime, there is a NullReferenceException produced by parameters.GetValueOrDefault<SortOrder>(nameof(SortOrder))
on line 279 in SetParametersAsync(ParameterView parameters). The exception is only thrown if the value of the property changes to NULL during runtime. An initial NULL value is accepted.

Expected behavior
There should be used the nullable type in GetValueOrDefault<SortOrder>(nameof(SortOrder)) => GetValueOrDefault<SortOrder?>(nameof(SortOrder)) and no NullReferenceException should be thrown.

Desktop (please complete the following information):

  • OS: Windows Server 2016
  • Browser: Edge
  • Version: 3.93

Additional context
.NET 5, Blazor server-side

Originally created by @Mastaleck on GitHub (Aug 24, 2021). If the `SortOrder` parameter of a `RadzenDataGridColumn` is bound to a field of type `SortOrder?` and the value is set to `NULL` during runtime, there is a `NullReferenceException` produced by `parameters.GetValueOrDefault<SortOrder>(nameof(SortOrder))` on line 279 in `SetParametersAsync(ParameterView parameters)`. The exception is only thrown if the value of the property changes to `NULL` during runtime. An initial `NULL` value is accepted. **Expected behavior** There should be used the nullable type in `GetValueOrDefault<SortOrder>(nameof(SortOrder))` => `GetValueOrDefault<SortOrder?>(nameof(SortOrder))` and no `NullReferenceException` should be thrown. **Desktop (please complete the following information):** - OS: Windows Server 2016 - Browser: Edge - Version: 3.93 **Additional context** .NET 5, Blazor server-side
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#183