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

Error when binding data to grid remotesaveadapter

Hi, 
I am trying to reproduce the sample in documentation given in url: https://ej2.syncfusion.com/aspnetmvc/documentation/grid/data-binding/#remote-save-adaptor
but, I am getting an error: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
  HResult=0x80131500
  Message=The best overloaded method match for 'Syncfusion.EJ2.DataManagerBuilder.Json(object[])' has some invalid arguments

In the file attached there are some evidences of the way I am coding.

Thanks for your help,
Juan J.

Attachment: syncfusionrsa_87630ea4.zip

1 Reply

TS Thavasianand Sankaranarayanan Syncfusion Team March 6, 2019 05:07 AM UTC

Hi Juan, 

Greetings from Syncfusion. 

We have analyzed the screen shots you have shared with us. We could see that the data you are binding to Grid is not proper. We suggest you to assign array of objects to the JSON property of DataManager. So, we suggest you to add the “ToArray()” in your code to achieve your requirement. 

 
      @(Html.EJS().Grid("Grid").DataSource(dataManager => 
      { 
           dataManager.Json(ViewBag.dataSource.ToArray()).Adaptor("RemoteSaveAdaptor"); 
      }).Columns(col => 
      { 
           ... 
      }).AllowPaging().Render()) 


Please get back to us if you need further assistance. 

Regards, 
Thavasianand S. 


Loader.
Live Chat Icon For mobile
Up arrow icon