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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Following documentation steps in Getting Started (Grid) get FileNotFoundException

Thread ID:

Created:

Updated:

Platform:

Replies:

144695 May 17,2019 03:14 PM UTC May 21,2019 04:12 AM UTC Blazor 6
loading
Tags: Grid
Daniel
Asked On May 17, 2019 03:14 PM UTC

"Syncfusion.EJ2.AspNet.Core.RazorComponents" Version="17.1.0.47-beta"
VS Preview 16.1.0 Preview 3.0
Server-Side Blazor

changing <table class="table">....  in FetchData.razor with 

<Ejs-grid id="Grid" DataSource="@forecasts">
    <GridColumns>
        <GridColumn Field="Date" HeaderText="Date"></GridColumn>
        <GridColumn Field="TemperatureC" HeaderText="Temp. (C)"></GridColumn>
        <GridColumn Field="TemperatureF" HeaderText="Temp. (F)"></GridColumn>
        <GridColumn Field="Summary" HeaderText="Summary"></GridColumn>
    </GridColumns>
</Ejs-grid>

will not work. 
FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. The system cannot find the file specified.



Uwe Hein
Replied On May 18, 2019 07:07 AM UTC

Hi Daniel,

   just add Newtonsoft.Json with the Package Manager and it will work.

      regards

          Uwe

Daniel
Replied On May 18, 2019 06:40 PM UTC

Hi Uwe,

I try adding this :
"Newtonsoft.Json 12.0.2" or "Microsoft.AspNetCore.Mvc.NewtonsoftJson  3.0.0-preview5-19227-01"

but now i get this error:
NullReferenceException: Object reference not set to an instance of an object.
Syncfusion.EJ2.RazorComponents.Grids.GridColumns.OnInit()

I have attached the project

Thanks

Attachment: WebApplication1_359cac46.zip

Uwe Hein
Replied On May 20, 2019 07:15 AM UTC

Hi Daniel,

  thanks for your code. I did just a quick and dirty hack <G>

  change your FetchData.razor to the code at the end.

Download the blazor samples at

https://github.com/syncfusion/ej2-aspnet-core-blazor-samples

and check the grid samples...

    regards

      Uwe



@page "/fetchdata"

@using WebApplication1.Data

@using Syncfusion.EJ2.RazorComponents
@using Syncfusion.EJ2.RazorComponents.Grids

@inject WeatherForecastService ForecastService

<h1>Weather forecast</h1>

<p>This component demonstrates fetching data from a service.</p>

@if (forecasts == null)
{
<p><em>Loading...</em></p>
}
else
{
<EjsGrid id="Grid" ref="defaultGrid" DataSource="@gridData" AllowPaging="true">
<GridPageSettings PageCount="5"></GridPageSettings>
<GridColumns>
<GridColumn Field="Date" HeaderText="Date"></GridColumn>
<GridColumn Field="TemperatureC" HeaderText="Temp. (C)"></GridColumn>
<GridColumn Field="TemperatureF" HeaderText="Temp. (F)"></GridColumn>
<GridColumn Field="Summary" HeaderText="Summary"></GridColumn>
</GridColumns>
</EjsGrid>
}

@functions {

EjsGrid defaultGrid;

public object gridData { get; set; }

WeatherForecast[] forecasts { get; set; }

protected override async Task OnInitAsync()
{
forecasts = await ForecastService.GetForecastAsync(DateTime.Now);
}

protected override void OnAfterRender()
{
this.defaultGrid.DataSource = gridData = forecasts;
}
}



Pavithra Subramaniyam [Syncfusion]
Replied On May 20, 2019 11:43 AM UTC

Hi Daniel, 
  
Thanks for your sample code. 
  
We have checked the attached sample and we suggest you to use the grid tag(<EjsGrid >), which is the tag we have used for Grid rendering and we suggest you to import the Syncfusion.EJ2.RazorComponents as like below. Please refer the below code snippet, sample link and demo link. 
  
[fetchData.razor] 
@page "/fetchdata" 
@using WebApplication1.Data 
@inject WeatherForecastService ForecastService 
@using Syncfusion.EJ2.RazorComponents.Grids 
@using Newtonsoft.Json; 
  
<h1>Weather forecast</h1> 
  
<p>This component demonstrates fetching data from a service.</p> 
  
@if (forecasts == null) 
    <p><em>Loading...</em></p> 
else 
    <EjsGrid id="Grid" DataSource="@forecasts"> 
            <GridColumns> 
                <GridColumn Field="Date" HeaderText="Date"></GridColumn> 
                       .   .   .   . 
            </GridColumns> 
        </EjsGrid
  
@functions { 
    WeatherForecast[] forecasts; 
    protected override async Task OnInitAsync() 
    { 
        forecasts = await ForecastService.GetForecastAsync(DateTime.Now); 
    } 
  
  
  
Please get back to us for further assistance. 
  
Regards, 
Pavithra S. 
 


Daniel
Replied On May 20, 2019 07:38 PM UTC

Thanks Uwe and Pavithra,

Is working now

Regards,
Daniel

Pavithra Subramaniyam [Syncfusion]
Replied On May 21, 2019 04:12 AM UTC

Hi Daniel,  

Thanks for your update. 

We are happy to hear that the provided solution is working. 

Please contact us if you need any further assistance. As always, we will be happy to assist you.  

Regards,  
Pavithra S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon