exception after closing Grid's modal edit dialog - Add action, if no record is selected

Hi, when I try to Cancel a row creation i Grid's modal edit dialog - add action (either by clickin Cancel or just by closing the dialog) and there's no row selected in the grid, I get this exception:

warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]

Unhandled exception rendering component: Object reference not set to an instance of an object.

System.NullReferenceException: Object reference not set to an instance of an object.

at Syncfusion.Blazor.Grids.Internal.Edit`1.CloseEdit(Boolean escapeKey)

at Syncfusion.Blazor.Grids.Internal.DialogEdit`1.b__0_12()

at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

at Syncfusion.Blazor.Internal.SfBaseUtils.InvokeEvent[T](Object eventFn, T eventArgs)

at Syncfusion.Blazor.Buttons.SfButton.OnClickHandler(MouseEventArgs args)

at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

fail: Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost[111]

Unhandled exception in circuit 'en85o6fEM5n-usgy411EU7ly8iuNKabx7PHjZDDPBFw'.

System.NullReferenceException: Object reference not set to an instance of an object.

at Syncfusion.Blazor.Grids.Internal.Edit`1.CloseEdit(Boolean escapeKey)

at Syncfusion.Blazor.Grids.Internal.DialogEdit`1.b__0_12()

at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

at Syncfusion.Blazor.Internal.SfBaseUtils.InvokeEvent[T](Object eventFn, T eventArgs)

at Syncfusion.Blazor.Buttons.SfButton.OnClickHandler(MouseEventArgs args)

at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)


This isn't the case, if a row in the Grid is selected.


Grid:

<SfGrid DataSource="@Orders" Toolbar="@(new List<string>() { "Add", "Edit", "Delete" })">

    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"

                      Mode="EditMode.Dialog" ShowDeleteConfirmDialog="true">

    </GridEditSettings>

</SfGrid>


@code {

    public List<Order> Orders { get; set; }


    protected override void OnInitialized()

    {

        Orders = Enumerable.Range(1, 5).Select(x => new Order()

            {

                OrderID = 0 + x,

                CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],

            }).ToList();

    }


    public class Order

    {

        public int? OrderID { get; set; }

        public string CustomerID { get; set; }


    }

}


3 Replies 1 reply marked as answer

MS Monisha Saravanan Syncfusion Team August 29, 2022 01:52 PM UTC

Hi Zdenek,


Greetings from Syncfusion support.


We have confirmed this as an issue and logged the defect report “Exception throws when clicking cancel icon in Add form” for the same. Thank you for taking time to report this issue and helping us to improve our product. At Syncfusion, we are committed to fix all validated defects (subject to technological feasibility and Product Development Life Cycle) and this fix will be included in our upcoming patch release which is expected to be rolled out on or before 21st   September, 2022.


You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.       


https://www.syncfusion.com/feedback/37296/exception-throws-when-clicking-cancel-icon-in-add-form


Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization”


Until then we appreciate your patience.


Regards,

Monisha S




SG Suganya Gopinath Syncfusion Team September 29, 2022 07:00 AM UTC

Hi Monisha,

Please update the status ASAP.



MS Monisha Saravanan Syncfusion Team September 30, 2022 03:48 AM UTC

Hi Zdenek,


We are glad to announce that, we have included fix for the issue “Exception throws when clicking cancel icon in Add formin our volume 3 release.  So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the Nuget package for latest fixes and features from below.


Nuget : https://www.nuget.org/packages/Syncfusion.Blazor.Grid


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 

   

Regards,            

Monisha


Marked as answer
Loader.
Up arrow icon