How to use Essencial JS2 grid in Essencial JS1 application

I installed Syncfusion.EJ2.MVC5 Syncfusion.EJ2.JavaScript.
I added file refers in layout.cshtml (    @Scripts.Render("~/Scripts/ej2/ej2.min.js"),     @Styles.Render("~/Content/ej2/compatibility/material.css?v=" + Constants.versionFile))
Also I added this script for compatibility:
    @RenderSection("scripts", required: false)
    <script>
        // Extend ej namespace with Syncfusion
        var dataCopy = Object.assign({}, ej.data);
        $.extend(ej, Syncfusion);
        $.extend(ej.data, dataCopy);
    </script>
And in my partial view i used this code:
@Html.EJS().Grid("Grid")
                        .DataSource((System.Data.DataTable)ViewBag.DataSource)
                        .EnableVirtualization()
                        .Height("300")
                        .Width("auto")
                        .AllowSelection()
                        .Columns(ViewBag.cols)
But the grid isn't shown.I get this expression in the page :
Syncfusion.EJ2.Grids.GridBuilder .DataSource((System.Data.DataTable)ViewBag.DataSource) .EnableVirtualization() .Height("300") .Width("auto") .AllowSelection() .Columns(ViewBag.cols) 




2 Replies

BB Bassem Ben ALI May 30, 2018 02:14 PM UTC

I arrived to show the grid but it contains white lines (doesn't show data)

Attachment: Capture_8e6ce6e.7z


RS Renjith Singh Rajendran Syncfusion Team May 31, 2018 02:05 PM UTC

Hi Bassem, 

Thanks for contacting Syncfusion support. 

We suspect that the issue may have arisen because of the field’s casing problem or field names mismatch with datasource property. To render the Grid data, column’s field names and the property name in the data source should be same. After that Grid will be rendered with data. So we suggest you to ensure this in your sample application. 

For your convenience, we have prepared an MVC application containing both Essential JS2 Grid and Essential JS1 Grid. Please download the sample from the link below, 
 
If you still face the issue. Please get back to us with the following details, 

  1. Essential JS2 version details.
  2. Are you using remote data or local data?
  3. Are you binding Table or List to your Grid?
  4. Share the platform details(MVC or ASP.NET Core).
  5. Share full Grid code example.
  6. Share the stack trace of the issue if any script error occur in console window.
  7. If you have enable any adaptor in your sample then provide those detail.

The provided information will help us to analyze the issue and provide you the response as early as possible. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Up arrow icon