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

I cannot find example of DataManager bind remote data of ej-grid to webapi (ASP.NET)

Thread ID:





117462 Oct 25,2014 05:19 AM UTC Oct 27,2014 09:21 AM UTC JavaScript 1
Tags: ejDataManager
Krittikorn Deeraksa
Asked On October 25, 2014 05:19 AM UTC

I cannot find example of DataManager bind remote data of ej-grid to  webapi (ASP.NET)

I try ajax it can bind but on first time not bind (click 2nd time if bind)
I try to use your dataManager by see another example it can not work.

thank for advise

Alan Sangeeth S [Syncfusion]
Replied On October 27, 2014 09:21 AM UTC

Hi Krittikorn


We are sorry for the inconvenience caused.


We have created a sample based on your requirement and the same can be downloaded from below link.

Sample: http://www.syncfusion.com/downloads/support/directtrac/131200/ASPSample-1139529559.zip


We have used a custom adaptor in the above sample to bind data from webapi service to Grid and we have already logged issue report “Need to create adaptor for WebApi”  to include an adaptor for WebApi service in DataManager and it will be included in upcoming Volume 3, 2014 release.


We also would like to let you know that from WebApi service we need to return data with its count and so we have used “PageResult” to do the same. Please refer the following code snippets.

<ej:Grid ID="EmployeesGrid" runat="server" AllowSorting="true" AllowPaging="true" Load="load">

        <DataManager URL="api/Values"></DataManager>




        var adaptor = new ej.ODataAdaptor().extend({

            processResponse: function (data, ds, query, xhr, request, changes) {

                if (request.type != "POST")

                    return { result: data.Items, count: data.Count }



        function load(args) {

            args.model.dataSource.adaptor = new adaptor;




public class ValuesController : ApiController


        public PageResult<Order> Get(ODataQueryOptions opts)


            var results = opts.ApplyTo(db.Orders.AsQueryable());

            var data = db.Orders.AsQueryable();

            return new PageResult<Order>((IEnumerable<Order>)results, Request.GetNextPageLink(), data.Count());




Please let us know if you have any queries.

Alan Sangeeth S


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

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