Hello everybody,
I have a problem with the DataGrid. Sorting a column suddenly stopped working.
Unfortunately, I can no longer understand what I have changed.
I actually only updated Visual Studio Enterprise 2019 (now in v16.8.2).
Does anyone have an idea what suddenly goes wrong?
I hope I described my first post in this forum reasonably well.
Thank you for your attention.
My Environment
Visual Studio Enterprise 2019 v16.8.2
Blazor wasm / Server App
NuGetPackage Radzen.Blazor 2.17.10
Component (razor)
if (_objectAttributeValueCounts == null)
{
<div class="spinner-border text-dark" role="status">
<span class="sr-only">Loading...</span>
</div>
}
else
{
<RadzenGrid AllowFiltering="false" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterMode="FilterMode.Simple"
AllowPaging="false" PageSize="10" AllowSorting="true" Data="_objectAttributeValueCounts" TItem="DdsObjectAttributeValueCount">
<Columns>
<RadzenGridColumn Width="320px" Filterable="false" TItem="DdsObjectAttributeValueCount" Property="ObjectUuid" Title="Objekt Uuid" />
<RadzenGridColumn Width="100%" TItem="DdsObjectAttributeValueCount" Property="Count" Title="Count of Attribute Values" />
</Columns>
</RadzenGrid>
}
The partial CodeBehind of Component
[UsedImplicitly]
public partial class ObjectAttributeValueCountComponent
{
#region Constants - Static fields - Fields
private IEnumerable<DdsObjectAttributeValueCount> _objectAttributeValueCounts;
#endregion
#region Properties
[Inject]
private HttpClient HttpClient { get; [UsedImplicitly] set; } = null;
#endregion
#region Methods
protected override async Task OnInitializedAsync()
{
_objectAttributeValueCounts =
await HttpClient
.GetFromJsonAsync<List<DdsObjectAttributeValueCount>
>("/api/DdsDashboard/GetDdsObjectAttributeValueCount");
_objectAttributeValueCounts = _objectAttributeValueCounts.AsQueryable();
}
#endregion
}
The Data Model
public class DdsObjectAttributeValueCount
{
public int Count { get; set; }
public string ObjectUuid { get; set; }
}
The Error that is thrown
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: Cannot read property 'removeChild' of null
TypeError: Cannot read property 'removeChild' of null
at e (https://localhost:5001/_framework/blazor.webassembly.js:1:6918)
at Object.e [as removeLogicalChild] (https://localhost:5001/_framework/blazor.webassembly.js:1:6890)
at e.applyEdits (https://localhost:5001/_framework/blazor.webassembly.js:1:13649)
at e.updateComponent (https://localhost:5001/_framework/blazor.webassembly.js:1:12880)
at Object.renderBatch (https://localhost:5001/_framework/blazor.webassembly.js:1:1704)
at Object.renderBatch (https://localhost:5001/_framework/blazor.webassembly.js:1:34784)
at _mono_wasm_invoke_js_unmarshalled (https://localhost:5001/_framework/wasm/dotnet.3.2.0.js:1:172099)
at wasm_invoke_iiiiii (<anonymous>:wasm-function[3160]:0x9b33d)
at icall_trampoline_dispatch (<anonymous>:wasm-function[5777]:0xfe711)
at mono_wasm_interp_to_native_trampoline (<anonymous>:wasm-function[4607]:0xca81d)
Microsoft.JSInterop.JSException: Cannot read property 'removeChild' of null
TypeError: Cannot read property 'removeChild' of null
at e (https://localhost:5001/_framework/blazor.webassembly.js:1:6918)
at Object.e [as removeLogicalChild] (https://localhost:5001/_framework/blazor.webassembly.js:1:6890)
at e.applyEdits (https://localhost:5001/_framework/blazor.webassembly.js:1:13649)
at e.updateComponent (https://localhost:5001/_framework/blazor.webassembly.js:1:12880)
at Object.renderBatch (https://localhost:5001/_framework/blazor.webassembly.js:1:1704)
at Object.renderBatch (https://localhost:5001/_framework/blazor.webassembly.js:1:34784)
at _mono_wasm_invoke_js_unmarshalled (https://localhost:5001/_framework/wasm/dotnet.3.2.0.js:1:172099)
at wasm_invoke_iiiiii (<anonymous>:wasm-function[3160]:0x9b33d)
at icall_trampoline_dispatch (<anonymous>:wasm-function[5777]:0xfe711)
at mono_wasm_interp_to_native_trampoline (<anonymous>:wasm-function[4607]:0xca81d)
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[T0,T1,T2,TResult] (System.String identifier, T0 arg0, T1 arg1, T2 arg2) <0x300af30 + 0x00046> in <filename unknown>:0
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[T0,T1,TResult] (System.String identifier, T0 arg0, T1 arg1) <0x300ae50 + 0x00014> in <filename unknown>:0
at Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.UpdateDisplayAsync (Microsoft.AspNetCore.Components.RenderTree.RenderBatch& batch) <0x300ad58 + 0x0001e> in <filename unknown>:0
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue () <0x2e31138 + 0x000f2> in <filename unknown>:0