Your search did not match any results.
Data Grid

Custom Data Source

Documentation
For consuming data from a data source, which is not supported by the DevExtreme data layer out of the box, the DataGrid uses the CustomStore. To load data, the CustomStore needs the load function that you should implement by yourself. Note that this store can be declared explicitly or in the DataSource configuration object.
@(Html.DevExtreme().DataGrid() .ID("gridContainer") .DataSource(new JS("orders")) .RemoteOperations(ro => ro .Sorting(true) .Paging(true) ) .Paging(p => p.PageSize(12)) .Pager(p => p .ShowPageSizeSelector(true) .AllowedPageSizes(new[] { 8, 12, 20 }) ) .Columns(c => { c.Add().DataField("OrderNumber"); c.Add().DataField("OrderDate"); c.Add().DataField("StoreCity"); c.Add().DataField("StoreState"); c.Add().DataField("Employee"); c.Add() .DataField("SaleAmount") .Format(Format.Currency); }) ) <script src="~/Scripts/data/orders.js"></script>
using DevExtreme.MVC.Demos.Models; using DevExtreme.MVC.Demos.Models.SampleData; using System; using System.Linq; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class DataGridController : Controller { public ActionResult CustomDataSource() { return View(); } } }
var orders = new DevExpress.data.CustomStore({ load: function(loadOptions) { var deferred = $.Deferred(), args = {}; if(loadOptions.sort) { args.orderby = loadOptions.sort[0].selector; if(loadOptions.sort[0].desc) args.orderby += " desc"; } args.skip = loadOptions.skip || 0; args.take = loadOptions.take || 12; $.ajax({ url: "https://js.devexpress.com/Demos/WidgetsGallery/data/orderItems", data: args, success: function(result) { deferred.resolve(result.items, { totalCount: result.totalCount }); }, error: function() { deferred.reject("Data Loading Error"); }, timeout: 5000 }); return deferred.promise(); } });