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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Putting header in DataManager

Thread ID:





128473 Jan 25,2017 07:53 AM UTC Jan 31,2017 11:05 AM UTC Angular 3
Tags: ejDatamanager
Dina Abdelbary
Asked On January 25, 2017 07:53 AM UTC


I m using an api service method to get the datasource for an ejGrid to do virtual scrolling

"getReportData() {
    this.gridData = new ej.DataManager({
      url: 'http://localhost:43317/api/WebReports/GetReportData/'+ this.reportId,
      adaptor: new ej.UrlAdaptor()
      ,crossDomain: true

" public IEnumerable<dynamic> GetReportData( int id, DataManager dm)
               return res;
and i m putting "[EnableCors(origins: "http://localhost:3000", headers: "*", methods: "*")]" above the controller to enable cors.

but this error appears

"XMLHttpRequest cannot load http://localhost:43317/api/WebReports/GetReportData/61. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 405."

i think the solution is putting a header at the request of the datamanager, but i don't know how.

Please advise.

Karthikeyan Viswanathan [Syncfusion]
Replied On January 26, 2017 05:07 PM UTC

Hi Dina Abdelbary, 
Thanks for contacting Syncfusion support. 
We analyzed the code examples that you have shared. If you would like to fetch data from a custom action of controller, then we suggest you to use without localhost URL of the DataManager.  
Please refer to the below online documentation in which we have explained in detail on the various data binding concepts help link: https://help.syncfusion.com/js/datamanager/data-adaptors#url-adaptor  
We have prepared a grid sample with URL adaptor binding, which can be downloaded from the below location.  

Karthikeyan V. 

Dina Abdelbary
Replied On January 29, 2017 10:27 AM UTC


The demo you have attached uses jquery not angular2 !! and also my question uses web api service, and the attached one uses a normal Controller not ApiController,
what do you mean about "use without localhost URL of the DataManager", so what if i wanna call a web api service method??
and also i asked about how to set the header at the request of the datamanager


Prince Oliver [Syncfusion]
Replied On January 31, 2017 11:05 AM UTC

Hi Dina, 

Thanks for using Syncfusion products. 
We have created a new incident under your account. We suggest you to follow up the incident for further reference using your direct trac account.  
Please let us know if you have any concerns. 



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

or the page will be automatically redirected to 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