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.
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.
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; }
}
}
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
Hi Monisha,
Please update the status ASAP.
Hi Zdenek,
We are glad to announce that, we have included fix for the issue “Exception throws when clicking cancel icon in Add form” in 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