GridEditSettings - HeaderTemplate - System.ArgumentException: There is no tracked object with id 'XX'. Perhaps the DotNetObjectReference instance was already disposed. (Parameter 'dotNetObjectId')

Hello,

I have the following Grid definition on my page : 

<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:1
    at 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





6 Replies 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team June 5, 2020 10:32 AM UTC

Hi Jean, 

Greetings from Syncfusion support. 

We have confirmed this as a bug and logged defect report for the same Script error thrown in console during navigation in a Grid having HeaderTemplate. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming Volume 2 release which is expected to be rolled out by the end of June, 2020. 
   
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.   
 
Please get back to us if you need further assistance.  

Regards, 
Renjith Singh Rajendran 


Marked as answer

JR Jason Rodriguez February 8, 2023 04:15 PM UTC

Hello Syncfusion, I am still experiencing this in version 20.2.36. Any reason as to why?



SP Sarveswaran Palani Syncfusion Team February 11, 2023 06:58 AM UTC

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



KC Kevin Christian G. Cabana October 25, 2023 04:02 AM UTC

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



KC Kevin Christian G. Cabana replied to Kevin Christian G. Cabana October 25, 2023 04:07 AM UTC

here is my sample screenshot



NP Naveen Palanivel Syncfusion Team November 1, 2023 11:36 PM UTC

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.


  1. Share us the entire Grid code snippet along with model class
  2. Kindly confirm whether the reported problem happens in the latest version 23.1.43 on your side.
  3. Please share if we missed any replication procedure in attached sample
  4. Share a video demonstration of the issue with a detailed explanation. This will greatly assist us in understanding the problem.
  5. 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

Loader.
Up arrow icon