GridEditSettings - HeaderTemplate - System.ArgumentException: There is no tracked object with id 'XX'. Perhaps the DotNetObjectReference instance was already disposed. (Parameter 'dotNetObjectId')
<SfGrid ID="GridBoConfig" CssClass="e-primary" TValue="BackOfficeGroupDto" AllowReordering="true" AllowResizing="true" AllowPaging="true" AllowFiltering="true" AllowSorting="true" AllowSelection="true" Toolbar=@Tool @ref="GridBoGrpConfig" ShowColumnChooser="false" EnablePersistence="false" Query=@GridQuery>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" ShowDeleteConfirmDialog="true" Mode="EditMode.Dialog" Dialog="@Dialog">
<HeaderTemplate>
@EditFormHeader
</HeaderTemplate>
</GridEditSettings>
<GridEvents OnToolbarClick="ToolbarClickHandler" TValue="BackOfficeGroupsAdaptor"></GridEvents>
<GridSearchSettings Operator=Syncfusion.Blazor.Operator.Contains IgnoreCase="true"></GridSearchSettings>
<GridPageSettings PageSize="15" PageSizes="@pageSizes" />
<DataManager AdaptorInstance="@typeof(BackOfficeGroupsAdaptor)" Adaptor="Adaptors.CustomAdaptor"></DataManager>
<GridFilterSettings>
<GridFilterColumns>
<GridFilterColumn Field="@nameof(BackOfficeGroupDto.Name)" MatchCase=false Operator="Operator.Contains" Predicate="and"></GridFilterColumn>
</GridFilterColumns>
</GridFilterSettings>
<GridEvents OnActionBegin="OnBeginCommandBackOfficeConfigurations" TValue="BackOfficeGroupDto"></GridEvents>
<GridColumns>
<GridColumn HeaderText="@R["Edit"]" Width="120" AllowFiltering="false" AllowSorting="false" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Center">
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Edit" ButtonOption="@(new CommandButtonOptions() { IconCss = "e-icons e-edit", CssClass = "e-flat" })">
<GridFilterSettings ShowFilterBarStatus="false"></GridFilterSettings>
</GridCommandColumn>
<GridCommandColumn Type="CommandButtonType.Delete" ButtonOption="@(new CommandButtonOptions() { IconCss = "e-icons e-delete", CssClass = "e-flat" })"></GridCommandColumn>
</GridCommandColumns>
</GridColumn>
@*<GridColumn Field=@nameof(BackOfficeGroupDto.IsDefault) HeaderText="@R["IsDefault"]" TextAlign="Syncfusion.Blazor.Grids.TextAlign.Center" Type="ColumnType.Boolean" DisplayAsCheckBox="true" EditType="EditType.BooleanEdit" AllowFiltering="false" AllowSorting="false" Width="100">
</GridColumn>*@
<GridColumn Field=@nameof(BackOfficeGroupDto.Name) HeaderText="@R["GroupName"]" Width="150">
</GridColumn>
<GridColumn Field=@nameof(BackOfficeGroupDto.MembersIds) MinWidth="200" AutoFit="true" AllowFiltering="false" AllowEditing="false" AllowSorting="false">
<HeaderTemplate>
@R["BackOfficeMembers"]
</HeaderTemplate>
<Template>
@((context as BackOfficeGroupDto)?.MembersNames)
</Template>
<EditTemplate></EditTemplate>
</GridColumn>
<GridColumn Field=@nameof(BackOfficeGroupDto.UpdatedOn) HeaderText="@R["UpdatedOn"]" CustomFormat="@(new { type= "date", format= "dd/MM/yyyy hh:mm:ss" })" Type="ColumnType.DateTime" AllowEditing="false" AllowFiltering="false" Width="150">
<FilterTemplate>
<SfDatePicker @ref="dtpLastUpdatedBy" TValue="DateTime?" Placeholder="@R["ChooseADate"]" @bind-Value="@UpdatedOnValue" ShowClearButton="true" Format="dd-MM-yyyy">
<DatePickerEvents TValue="DateTime?" ValueChange="onDateChange" Cleared="onLastUpdatedOnDateCleared"></DatePickerEvents>
</SfDatePicker>
</FilterTemplate>
<EditTemplate></EditTemplate>
</GridColumn>
<GridColumn Field=@nameof(BackOfficeGroupDto.UpdatedBy) HeaderText="@R["UpdatedBy"]" AllowEditing="false" Width="150">
<EditTemplate></EditTemplate>
</GridColumn>
</GridColumns>
</SfGrid>
I use an edit form dialog and I have defined a header template (see above code in highlight).
I set the dialog title with the variable EditFormHeader as follow:
public async void OnBeginCommandBackOfficeConfigurations(ActionEventArgs<BackOfficeGroupDto> args){case Syncfusion.Blazor.Grids.Action.Add:{EditFormHeader = "New BackOffice Group";break;}case Syncfusion.Blazor.Grids.Action.BeginEdit:{EditFormHeader = "Edit of <" + args.RowData.Name + "> group";break;}}My problem is that when I leave the page, I receive the following error:
blazor.server.js:8 Uncaught (in promise) Error: System.ArgumentException: There is no tracked object with id '5'. Perhaps the DotNetObjectReference instance was already disposed. (Parameter 'dotNetObjectId')at Microsoft.JSInterop.JSRuntime.GetObjectReference(:44384/Int64 dotNetObjectId)at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(:44384/JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson)at Object.endInvokeDotNetFromJS (blazor.server.js:8)at e.<anonymous> (blazor.server.js:8)at blazor.server.js:1at Array.forEach (<anonymous>)at e.invokeClientMethod (blazor.server.js:1)at e.processIncomingData (blazor.server.js:1)at e.connection.onreceive (blazor.server.js:1)at WebSocket.i.onmessage (blazor.server.js:1)If I remove the Header Template, the error disappears.
Can you reproduce this problem from our side and find a solution?
Thank you in advance for your help.
Kind regards,
Jean-Yves Ceunen
Hello Syncfusion, I am still experiencing this in version 20.2.36. Any reason as to why?
Hi Jason,
Greetings from Syncfusion support.
Based on your query, we checked an issue in our latest NuGet version 20.4.0.49.
After reviewing your query, we were unable to replicate the issue you
mentioned. We recommend that you upgrade to our latest NuGet version as it may
resolve the problem. However, if the issue persists, please provide a video
demo and a simple issue reproducible sample. This will greatly assist us in
effectively evaluating and resolving your issue in a timely manner.
Regards,
Sarvesh
Hello Syncfusion, I am still experiencing this in version 23.1.41. Any reason as to why?
this is replicable if you double click the filter and other places
here is my sample screenshot
Hi Kevin,
Based on your query, it appears that exception occurs when
double click the filter. We have created a sample and validated it on our end.
However, the reported problem does not occur on our side. Please refer to the sample
for your reference.
If the reported issue still reproduced then kindly share the below details to
validate further at our end.
- Share us the entire Grid code snippet along with model class
- Kindly confirm whether the reported problem happens in the latest version 23.1.43 on your side.
- Please share if we missed any replication procedure in attached sample
- Share a video demonstration of the issue with a detailed explanation. This will greatly assist us in understanding the problem.
- Please provide a simple sample that reproduces the issue with duplicate data or try to modify the above mentioned sample.
The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.
Regards,
Naveen Palanivel
Attachment: BlazorApp_Kevin_c20e4f3d.zip
- 6 Replies
- 6 Participants
- Marked answer
-
JC Jean-Yves Ceunen
- Jun 4, 2020 01:32 PM UTC
- Nov 1, 2023 11:36 PM UTC