Your search did not match any results.

List - Web API Service

To access a Web API service from the client, use the createStore method which is part of the DevExtreme.AspNet.Data extension. This extension also allows you to process data for DevExtreme components on the server. The server-side implementation is available under the ListDataController.cs tab in the ASP.NET MVC version of this demo.

Backend API
@(Html.DevExtreme().List() .ItemTemplate(@<text> <div><%- ProductName %></div> <div><b><%- formatCurrency(UnitPrice) %></b></div> </text>) .DataSource(d => d.WebApi().Controller("ListData").Key("ProductID")) .DataSourceOptions(d => d .PageSize(1) .Sort("ProductName") .Group("Category.CategoryName") .Filter("[ 'UnitPrice', '>', '15' ]") ) .Grouped(true) .CollapsibleGroups(true) .ItemDeleteMode(ListItemDeleteMode.SlideItem) .SelectionMode(ListSelectionMode.Multiple) .ShowSelectionControls(true) .PageLoadMode(ListPageLoadMode.ScrollBottom) .Height(600) ) <script> var formatCurrency = new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", minimumFractionDigits: 2 }).format; </script>
using DevExtreme.MVC.Demos.Models.SampleData; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class ListController : Controller { public ActionResult WebApi() { return View(); } public ActionResult ListEditingAndAPI() { return View(); } public ActionResult GroupedList() { return View(SampleData.ListGroupedData); } public ActionResult ItemTemplate() { return View(SampleData.ListProducts); } public ActionResult ListWithSearchBar() { return View(SampleData.ListProducts); } public ActionResult ListSelection() { return View(SampleData.ListPlainData.Take(50)); } public ActionResult ItemDragging() { return View(); } } }
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Web.Http; using DevExtreme.MVC.Demos.Models.Northwind; namespace DevExtreme.MVC.Demos.Controllers.ApiControllers { public class ListDataController : ApiController { NorthwindContext _nwind = new NorthwindContext(); [HttpGet] public HttpResponseMessage Get(DataSourceLoadOptions loadOptions) { return Request.CreateResponse( DataSourceLoader.Load(_nwind.Products.Include("Category"), loadOptions) ); } } }

A 1-Click Solution for CRUD Web API Services with Role-based Access Control via EF Core

If you target .NET for your backend API, be sure to check out Web API Service and register your free copy today. The Solution Wizard scaffolds an OData v4 Web API Service (.NET 6+) with integrated authorization & CRUD operations powered by EF Core ORM. You can use OAuth2, JWT or custom authentication strategies alongside tools like Postman or Swagger (OpenAPI) for API testing. The built-in Web API Service also filters out secured server data based on permissions granted to users. Advanced/enterprise functions include audit trail, endpoints to download reports, file attachments, check validation, obtain localized captions, etc.

To use the free Solution Wizard (which creates the Web API Service), run the Universal Component Installer from the DevExpress Download Manager and use our predefined template in Visual Studio 2022+.

Read Tutorial | View Examples: JavaScript (DevExtreme) & JavaScript (Svelte) | Watch Videos