Skip to content

Infragistics Community Forum / Web / Ignite UI for Blazor / Blazor server Grid throw System.InvalidOperationException exception

Blazor server Grid throw System.InvalidOperationException exception

New Discussion
Himanshu Upadhyay
Himanshu Upadhyay asked on Feb 9, 2022 3:10 PM

I have build a blazor server application and followed example given at https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/grids/data-grid-cell-editing

I have set grid edit to “CellBatch” and whenever i click either (commit/undo/redo) button, application is throwing “System.InvalidOperationException: ‘cannot synchronously invoke a method without IJSInProcessRuntime'” exception.

Can you let us know what wrong i am doing. I just copied your sample. Or let us know if you have any other sample application for Blazor server with batch edit grid.

Attached is screen shot of error.

I also notice that if i create Blazor WebAssembly App, than same code work correctly.  Looks like this grid not build to work with Blazor server at this time.

Correct me if i am wrong.

Sign In to post a reply

Replies

  • 0
    Michael DiFilippo
    Michael DiFilippo answered on Feb 8, 2022 7:47 PM

    Hello and thank you for contacting Infragistics. I will be building a sample to help isolate the behavior. In the meantime, if you happen to have a sample that isolates the behavior please attach it and I will investigate this for you. 

    • 0
      Himanshu Upadhyay
      Himanshu Upadhyay answered on Feb 8, 2022 8:08 PM

      Thanks Michael for quick reply. 

      I am trying to upload zip file but getting this error. Is there any other way to upload zip file? 

  • 0
    Michael DiFilippo
    Michael DiFilippo answered on Feb 9, 2022 3:10 PM

    Hello and thank you for following up. Changes need to be made asynchronous in blazor server to the grid on the client browser. I changed your CommitEdits, Undo and Redo method calls to their async counterparts needed for blazor server and got things back to working again. Again, this is normal because the grid is loaded on the client browser not the server. 

    eg.

    private void OnCommitClick(MouseEventArgs e)
    {
    this.DataGridRef.CommitEditsAsync();
    StateHasChanged();

    }

    private void OnUndoClick(MouseEventArgs e)
    {
    this.DataGridRef.UndoAsync();
    StateHasChanged();

    }

    private void OnRedoClick(MouseEventArgs e)
    {
    this.DataGridRef.RedoAsync();
    StateHasChanged();

    }

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Himanshu Upadhyay
Favorites
0
Replies
3
Created On
Feb 09, 2022
Last Post
4 years ago

Suggested Discussions

Created by

Created on

Feb 9, 2022 3:10 PM

Last activity on

Feb 12, 2026 3:56 PM