DataGrid: saving settings + virtualization + sorting a column = System.ArgumentNullException #660

Open
opened 2026-01-29 17:41:09 +00:00 by claunia · 0 comments
Owner

Originally created by @Alex55040 on GitHub (Dec 6, 2022).

  1. Use the following example as a base
    https://blazor.radzen.com/datagrid-save-settings

The issue appears even without saving and loading the settings - just using only the bound settings property.

  1. Add virtualization as described here
    https://blazor.radzen.com/datagrid-virtualization-loaddata

  2. Now try to order some column - you'll get the System.ArgumentNullException inside the browser (MS Edge):

Error: System.ArgumentNullException: Value cannot be null. (Parameter 'source')
at Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1.BuildRenderTree(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

  1. Then set AllowVirtualization to "false", or remove @bind-Settings="@Settings" - the exception is gone. Filtering doesn't throw the exception.
Originally created by @Alex55040 on GitHub (Dec 6, 2022). 1. Use the following example as a base https://blazor.radzen.com/datagrid-save-settings The issue appears even without saving and loading the settings - just using only the bound settings property. 2. Add virtualization as described here https://blazor.radzen.com/datagrid-virtualization-loaddata 3. Now try to order some column - you'll get the System.ArgumentNullException inside the browser (MS Edge): Error: System.ArgumentNullException: Value cannot be null. (Parameter 'source') at Microsoft.AspNetCore.Components.Web.Virtualization.Virtualize`1.BuildRenderTree(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) 4. Then set AllowVirtualization to "false", or remove @bind-Settings="@Settings" - the exception is gone. Filtering doesn't throw the exception.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#660