Aps.Net Core 3.1 - Grid not showing the data - example attached

Hi,
I'm trying to use the grid with Asp.Net Core 3.1, but like the attached example, the grid does not show the data, can you give me any suggestion?

Regards.

Attachment: AspNetCore31_768e169a.zip

6 Replies 1 reply marked as answer

LU Lukkian April 21, 2020 06:23 PM UTC

I saw a similar question here, but the answer did not help me, as I followed all the steps and it still didn't work.

Good to remember that I am using MVC and UrlAdaptor.


FF Frederic FOURGEOT April 21, 2020 06:44 PM UTC

You must change the GridDataResult class like this :

    public class GridDataResult
    {
        [JsonProperty("count")]
        public int Count { get; set; }

        [JsonProperty("result")]
        public IEnumerable<object> Result{ get; set; }
    }

And of course :   var data = new GridDataResult { Result = models, Count = total };

And finally, because serialization use PascalCase in your project :

    <e-grid-columns>
        <e-grid-column field="Id" headerText="ID" type="string" textAlign="Left" allowEditing="false" isPrimaryKey="true"></e-grid-column>
        <e-grid-column field="Name" headerText="Name" type="string" textAlign="Left" allowEditing="false"></e-grid-column>
        <e-grid-column field="Doc" headerText="Doc" type="string" textAlign="Left" allowEditing="false"></e-grid-column>
    </e-grid-columns>
 


Marked as answer

LU Lukkian April 21, 2020 07:11 PM UTC

Exactly, thank you very much.


BS Balaji Sekar Syncfusion Team April 22, 2020 07:37 AM UTC

Hi Luis, 
  
We glad that your issue has been fixed.  
  
Please get back to us if you require further other assistance from us. 
  
Regards, 
Balaji Sekar. 



ES esayas February 2, 2021 09:27 AM UTC

I want to work on the Excel as CRUD but I face difficulty of data binding using aspnetcore 3.1 MVC.
Default View model working.
How I bind the excel cell to controllers of index, create, update, edit and delete action methods using data manager and/or data source or other mechanisms that have a database


SP Sangeetha Priya Murugan Syncfusion Team February 3, 2021 12:15 PM UTC

Hi esayas, 
 
Thank you for update. 
 
We have checked your requirement and the dataSourceChanged event handler will be triggered when editing, inserting a row and deleting a row is made on the datasource range. It is triggered with parameter named action which indicates edit, add and delete for the respective action. 
 
 
 <ejs-spreadsheet id="spreadsheet" openUrl="Home/Open" saveUrl="Home/Save" created="createdHandler" dataSourceChanged="onDataSourceChange"> 
</ejs-spreadsheet> 
 
 
<script> 
 
    function onDataSourceChange(args) { 
      //args.data returns the modified data in spreadsheet 
        switch (args.action) { 
            case "edit": 
                console.log("Edited Data: " + JSON.stringify(args.data)); 
                //Do your customization for edit action 
                break; 
            case "add": 
                console.log("Added Data: " + JSON.stringify(args.data)) 
                // Do your customization for insert action 
                break; 
            case "delete": 
                console.log("Deleted Data: " + JSON.stringify(args.data)) 
                // Do your customization edit action 
                break; 
        } 
    } 
</script>  
 
For your convenience, we have prepared the sample based on our suggestion. Please find the link below. 
 
 
Could you please check the above links and get back to us, if you need any further assistance on this. 
 
Regards, 
Sangeetha M 


Loader.
Up arrow icon