Add custom action links to column template

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

4 Replies

MA Marco Andrade February 9, 2021 01:38 PM UTC

Just a note, disregard the column collection, in my test app I set it up in code but don't loop through and add in the razor, it isn't related to the issue and can be ignored, it's really the GridActions collection and that last template column added at the end which creates action links. 


VN Vignesh Natarajan Syncfusion Team February 10, 2021 04:15 AM UTC

Hi Marco,  
 
Thanks for contacting Syncfusion support.  
 
Query: “he 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.  
 
We have validated the reported issue and we understand that you are facing the reported issue in web assembly application using Dotnet 3.x. It occur due to @onblur event and other specific events of Blazor for an element. They (button) have used Blazor native event for certain actions. Hence the reported issue has occur. It is not related to Syncfusion components alone, it is a Framework issue.  
 
Please find the below general Github issue for your reference 
 
 
Microsoft has resolved this issue in DotNet Core 5.0 RC1 release. So we suggest you to resolve the reported issue by upgrading the application to .Net Core 5.x and also Syncfusion.Blazor Nuget package to latest version (18.4.0.42) or minimum of 18.4.0.30 because we have updated the Razor Components to .Net 5.0 in our 2020 Volume 4 release. Please find the release notes regarding the same from below  
 
 
Please get back to us if you have further queries.     
 
Regards, 
Vignesh Natarajan 



MA Marco Andrade February 10, 2021 03:30 PM UTC

Thank you Vignesh, I had found the same in my own research. I was hoping there was another way of sending actions/method calls from my parent component into the SFGrid to bypass this limitation, do you know of any other ways to do other than how I am doing it with the action object? 


VN Vignesh Natarajan Syncfusion Team February 11, 2021 12:33 PM UTC

Hi Marco, 

 
Thanks for the update.  

 
Query: “I was hoping there was another way of sending actions/method calls from my parent component into the SFGrid to bypass this limitation, do you know of any other ways to do it other than how I am doing it with the action object? ” 

 
We have analyzed your query and we understand that you want to overcome the reported issue without upgrading your application. It will be very helpful for us to validate the alternative solution for your query with an issue reproducible sample. We are not able to reproduce the reported issue at our end.  

 
Kindly share a simple issue reproducible sample to validate the reported query at our end.  

 
Regards, 
Vignesh Natarajan 


Loader.
Up arrow icon