Hi, we are creating a wrapper component around the grid to better utilize it, I have set up my own column collection and action collection to pass from my parent component into the SFGrid, and they seem to work nicely. It will run through my column items and render an SFGrid column, and will render a template column at the end to display a list of my action objects and related action (passing an eventcallback object), I will post the razor and CS file below. This works great, and the action links execute whatever expression I pass, in this case a method call which passes the grid's selected item via the context object. What I am noticing is the action method in our application executes some injected services and then executes a navigate. The navigate sends them off, but seems to hit threading issues. I cannot recreate in a test application but will show you what we are doing generally. I am hoping there is an easier way, maybe using render fragments, to save the action's method instead of saving it to my collection as an eventcallback, bypassing this issue. The error doesn't happen on the action, but after it redirects, but my initial research shows it's all related and most likely due to the navigation and the thread it's running on, although I've awaited all calls as instructed.
Was hoping there was a better way of dynamically creating a list of actions for a grid and sending them to the SFGrid. If what I am doing is the best way to do this then I can try to get a sample app that causes the error to attach here, thinking there is an easier way to set up the actions though.
Using SyncFusion version 18.3.0.50. See razor and CS file attached. The error returned on our application is:
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Unknown edit type: 0
Error: Unknown edit type: 0
at e.applyEdits (https://localhost:44331/_framework/blazor.webassembly.js:1:15008)
at e.updateComponent (https://localhost:44331/_framework/blazor.webassembly.js:1:12880)
at Object.t.renderBatch (https://localhost:44331/_framework/blazor.webassembly.js:1:1704)
at Object.window.Blazor._internal.renderBatch (https://localhost:44331/_framework/blazor.webassembly.js:1:34784)
at _mono_wasm_invoke_js_unmarshalled (https://localhost:44331/_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 ves_pinvoke_method (<anonymous>:wasm-function[3209]:0x9cd40)
at interp_exec_method (<anonymous>:wasm-function[1120]:0x2598d)
Microsoft.JSInterop.JSException: Unknown edit type: 0
Error: Unknown edit type: 0
at e.applyEdits (https://localhost:44331/_framework/blazor.webassembly.js:1:15008)
at e.updateComponent (https://localhost:44331/_framework/blazor.webassembly.js:1:12880)
at Object.t.renderBatch (https://localhost:44331/_framework/blazor.webassembly.js:1:1704)
at Object.window.Blazor._internal.renderBatch (https://localhost:44331/_framework/blazor.webassembly.js:1:34784)
at _mono_wasm_invoke_js_unmarshalled (https://localhost:44331/_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 ves_pinvoke_method (<anonymous>:wasm-function[3209]:0x9cd40)
at interp_exec_method (<anonymous>:wasm-function[1120]:0x2598d)
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[T0,T1,T2,TResult] (System.String identifier, T0 arg0, T1 arg1, T2 arg2) <0x624b9b8 + 0x00046> in <filename unknown>:0
at Microsoft.JSInterop.WebAssembly.WebAssemblyJSRuntime.InvokeUnmarshalled[T0,T1,TResult] (System.String identifier, T0 arg0, T1 arg1) <0x624b8d8 + 0x00014> in <filename unknown>:0
at Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer.UpdateDisplayAsync (Microsoft.AspNetCore.Components.RenderTree.RenderBatch& batch) <0x624b7e0 + 0x0001e> in <filename unknown>:0
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue () <0x55bae98 + 0x000f2> in <filename unknown>:0
Attachment:
RazorAndCS_f3fa4305.zip