Grid filter mode causes exception

2 posts, 0 answers
  1. Eric
    Eric avatar
    10 posts
    Member since:
    Aug 2019

    Posted 24 Oct 2019 Link to this post

    I am seeing that the grid filter mode causes the following exception to be thrown: "System.InvalidOperationException: JavaScript interop calls cannot be issued at this time. This is because the component is being prerendered and the page has not yet loaded in the browser or because the circuit is currently disconnected. Components must wrap any JavaScript interop calls in conditional logic to ensure those interop calls are not attempted during prerendering or while the client is disconnected."

    Steps to reproduce (project using example from https://docs.telerik.com/blazor-ui/components/grid/overview is at https://github.com/austineric/GridTest):

    1. Open solution
    2. Ctrl + F5
    3. In the address bar add "/test" to the url
    4. In Visual Studio change the output to "GridTest - ASP.NET Core Web Server"
    5. Clear All in the output window
    6. Refresh the browser page
    7. View the exception in the output window
    8. Run the same test but remove the "FilterMode="Telerik.Blazor.GridFilterMode.FilterRow"" and see that the exception does not appear

    Error produced using

    • .Net Core 3.0.100
    • Telerik UI for Blazor 2.2.1
    • Visual Studio 16.3.5

    The grid appears to be working and filtering correctly despite the exception. Should I disregard? Should I be doing something differently?

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5940 posts

    Posted 25 Oct 2019 Link to this post

    Hi Eric, 

    The upgrade to .NET Core 3.1 should also include an upgrade to netcoreapp3.1 from netcoreapp3.0 as per the MS blog post (see the "Upgrade an existing project" section): https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-core-3-1-preview-1/.

    This removes the exception on my end.

    I created a pull request with the fix: https://github.com/austineric/GridTest/pull/1

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor
Back to Top