Grid no records to display

Hi,

I have a grid and I add the functionality of adding and updating, before publishing everything works fine but after publishing it and uploading it to the server the grid does not work, the grid not display data and I cannot add data either.

I attached the files.

Thanks,


Attachment: Code_32f691fd.zip

3 Replies

DR Dhivya Rajendran Syncfusion Team February 14, 2020 10:52 AM UTC

Hi Daniel, 

Greetings from Syncfusion support. 

We have validated the provided information and we suspect that you are facing a 404 error because UrlDatasource method are not reached in server side due to the relative path which you defined in DataSource method. By default, when you redirect the page from view to controller you have to follow the below syntax. 

 
@Url.Action(“ActionMethod”, “Controller”) 
 

To overcome the reported problem we suggest you to follow the below way that might helpful to resolve the problem. 

Index.cshtml 
 
@Html.EJS().Grid("gvAgentes"). 
DataSource(dataManager => { dataManager.Url(@Url.Action("UrlDatasource", "Agents")).InsertUrl("/Agents/Insert").UpdateUrl("/Agents/Update").Adaptor("UrlAdaptor"); } ).Columns(col => 
        { 
.  .  .  .  .  .   
.  .  .  .  .  . 
        }).EditSettings(e => { e.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Normal); }).AllowPaging().PageSettings(page => page.PageCount(2)).Toolbar(new List<string>() { "Add", "Edit", "Delete", "Update", "Cancel" }).Render() 
 
 

If you still have the issue, Please share more or below details that will be helpful for us to validate and provide an better solution as soon as possible. 

  1. Bind the ActionFailure event and share the arguments (error stack trace)
 

Regards, 
R.Dhivya 



DA Daniel February 14, 2020 07:44 PM UTC

Thanks Dhivya, I tested and work fine now.


DR Dhivya Rajendran Syncfusion Team February 17, 2020 05:46 AM UTC

Hi Daniel, 

Thanks for your update.  

We are happy to hear that the provided suggestion was helpful to resolve the reported problem. Please get back to us if you require further assistance from us. 

Regards, 
R.Dhivya 


Loader.
Up arrow icon