We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

TypeError: Cannot read property 'ej2_instances' of null

Hello,

when switching between different items in the navigation panel when going to a page that contains a grid component I get the following error: TypeError: Cannot read property 'ej2_instances' of null. An example code that throws this exception is:

@page "/temp"
@layout Shared.MainLayout
@using Syncfusion.EJ2.RazorComponents.Grids

<EjsGrid id="Grid" ref="otherGrid" DataSource="@gridData">
    <GridEditSettings allowAdding="true" allowEditing="true" allowDeleting="true" Mode="@EditMode.Dialog"></GridEditSettings>
    <GridColumns>
        <GridColumn Field=@nameof(OrdersDetails.CustomerID) HeaderText="Customer Name" Width="120"></GridColumn>
        <GridColumn Field=@nameof(OrdersDetails.OrderDate) HeaderText=" Order Date" Format="yMd" TextAlign="@TextAlign.Right" Width="130"></GridColumn>
        <GridColumn Field=@nameof(OrdersDetails.Freight) HeaderText="Freight" Format="C2" TextAlign="@TextAlign.Right" MinWidth="10" Width="120" MaxWidth="200"></GridColumn>
        <GridColumn Field=@nameof(OrdersDetails.ShipCountry) HeaderText="Ship Country" Width="150"></GridColumn>
    </GridColumns>
</EjsGrid>


@functions{
    EjsGrid otherGrid;

    public List<OrdersDetails> gridData { get; set; }

    protected override void OnAfterRender()
    {
        base.OnAfterRender();
        gridData = OrdersDetails.GetAllRecords();
    }
}

3 Replies

GS Gurupriyadharshini Sankaranarayanan Syncfusion Team June 13, 2019 12:51 PM UTC

Hi Ivan 
 
Thanks for contacting Syncfusion support. 
 
We have checked your query and we are able to reproduce the reported issue in our side. Currently we are validating this issue in our source side, we need time to investigate further about this issue so we will provide the further details about this issue on June 14th, 2019. 
 
Until then we appreciate your patience.   
 
Regards, 
Gurupriyadharshini S. 



GS Gurupriyadharshini Sankaranarayanan Syncfusion Team June 14, 2019 01:58 PM UTC

Hi Ivan 
   
Thanks for your patience. 
 
We have confirmed this issue from our side. We will include the fix for our Volume 2 beta release and it will be tentatively rolled out on June 27, 2019. Until then we appreciate your patience.   
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through the below link:  
 
Please get back to us if you need further assistance. 
 
Regards, 
Gurupriyadharshini S. 



GS Gurupriyadharshini Sankaranarayanan Syncfusion Team June 18, 2019 03:06 PM UTC

Hi Ivan, 
   
Thanks for your patience. 
 
We would like to inform you that your reported issue is resolved in our updated package version(17.1.0.52-beta) with .Net core 3 preview 6. We suggest you to update our latest package version and install .Net core 3 preview 6. We have prepared a sample where you can navigate the Grid page to another page without any issue. Please refer the below code snippet and sample link. 
 
[Index.razor] 
<EjsGrid id="Grid" @ref="@defaultGrid" DataSource="@gridData" AllowPaging="true"> 
    <GridPageSettings PageSize="5"></GridPageSettings> 
    <GridColumns> 
        <GridColumn Field=@nameof(OrdersDetails.OrderID) HeaderText="Order ID" TextAlign="@TextAlign.Right" Width="120"></GridColumn>         
        .  .  .  . 
    </GridColumns> 
</EjsGrid> 
 
@functions{ 
    EjsGrid defaultGrid; 
    public object gridData { get; set; } 
    protected override void OnAfterRender() 
    { 
        base.OnAfterRender(); 
        this.defaultGrid.DataSource = OrdersDetails.GetAllRecords().ToList(); 
        gridData = this.defaultGrid.DataSource; 
    } 
} 
 
 
Please get back to us if you need further assistance. 
 
Regards, 
Gurupriyadharshini S.

Loader.
Live Chat Icon For mobile
Up arrow icon