SfGrid throws Cannot read properties of null (reading 'style') when calling ResetPersistDataAsync
Hi,
Recently a js exception appeared after upgrading Syncfusion packages on some of our SfGrids (can't tell at which version it started).
It appears that when we have a DataGrid with a GridAggregates section and no GridAggregateColumns, calling ResetPersistDataAsync throws a js exception : Cannot read properties of null (reading 'style').
Here is a repro : https://blazorplayground.syncfusion.com/rXLHZrtdzmmHWlvq
The reason why we have the GridAggregates section without GridAggregateColumns is because we maintain a list of columns and sometimes there are no aggregate columns to display.
I've tried to encapsulate the whole section in a condition but it doesn't work well.
Looks like you need to fix the line where you do this :
0 !== n.options.aggregatesCount && (n.getFooterContent().querySelector(".e-table").style.width = "")
Regards,
Julien
Hi Julien Barach,
Based on reported problem we have confirmed that this is a breaking issue and
logged an issue “JS exception thrown when calling
ResetPersistDataAsync while GridAggregates exists without any
GridAggregateColumn” for the same. Thank you for taking the 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 patch
release which is expected to be rolled out on February 17th , 2026.
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.
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.
Regards,
Prathap Senthil
Thanks for your patience.
We are glad to announce that , we have included the fix for the “JS exception thrown when calling ResetPersistDataAsync while GridAggregates exists without any GridAggregateColumn” in our “32.2.5” 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
Sample: https://blazorplayground.syncfusion.com/embed/BDLnDVCGBBugPUdp?appbar=true&editor=true&result=true&errorlist=true&theme=bootstrap5
Root Cause:
The
footer table (.e-table) is accessed during ResetPersistDataAsync even when no
aggregate columns exist, causing getFooterContent().querySelector('.e-table')
to return null. Since the code attempts to set style.width on a null element, a
JavaScript exception is thrown.
Corrective Actions Taken:
Add a null check to ensure the footer table exists before accessing its style property. Updated condition prevents JS runtime errors by safely skipping style assignment when no aggregate footer table is rendered.
when i ommit the @{ brackets surounding the DetailTemplate area, I get an exception during ResetPersistData
<GridTemplates><DetailTemplate>
@{
<divstyle="width: calc(100vw - 30rem);"class="m-4 overflow-scroll card card-body shadow d-flex flex-column "><buttontype="button"class="btn btn-link" @onclick="() => { OpenInTab((contextasAuftragGridDto).AuftragId); }">⤴️ Im Tab öffnen</button><EditAuftragUrlAuftragId="(contextasAuftragGridDto).AuftragId"OnAuftragGeloescht="HandleAuftragGeloeschtAsync"OnAuftragGespeichert="HandleAuftragGespeichertAsync"></EditAuftrag></div>
}
</DetailTemplate></GridTemplates>
-> Button-> await GridAuftraege.ResetPersistDataAsync();
throws:
blazor.web.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Unhandled exception occurred during interop call.
System.InvalidOperationException: Unhandled exception occurred during interop call.
---> Microsoft.JSInterop.JSException: TypeError: Cannot read properties of null (reading 'querySelector')
I can´t reproduce the issue inside playground.
https://blazorplayground.syncfusion.com/rtLxDlXxrmhbhuRf
Hi Matthias,
We checked your query. It appears that when
the DetailTemplate content is wrapped inside @{ }, it works fine. However, when
the wrapper brackets @{ } are removed and ResetPersistDataAsync() is called, a
JavaScript exception occurs at your end. You also mentioned that you tried to
reproduce the issue in a simple sample, but it did not occur. We also checked
the reported issue by modifying our sample based on the code snippet you
shared. However, we were unable to reproduce the reported issue, and it works
fine at our end. Please refer to the attached sample for more information.
Sample : check the attachment
To help us investigate the reported issue further and provide an appropriate solution, could you please clarify the following:
- Could you share the complete Grid rendering code along with the model class? Based on your Grid configuration, we attempted to adjust our sample to replicate the issue.
- Based on the shared code, we see that a custom component is rendered inside the DetailTemplate. Please share the custom component code and additional details about its implementation.
- Please verify whether the issue still occurs after removing the custom component from the DetailTemplate. Based on the result, we may be able to gain further insight into where the issue originates.
- Please share the Syncfusion NuGet package version that you are using in your sample.
- Please share a detailed video
demonstration of the issue. This will be very helpful for us to analyze
the behavior and investigate it further.
The requested information will help us validate the scenario more effectively and provide an appropriate solution at the earliest.
Regards,
Naveen Palanivel
Attachment: BlazorApp1_85787c31.zip
- 4 Replies
- 4 Participants
- Marked answer
-
JB Julien Barach
- Feb 6, 2026 01:30 PM UTC
- Aug 8, 2026 01:36 PM UTC