Your search did not match any results.

Data Grid - OData Service

To fetch data from an OData service, implement an ODataStore. Use its properties to specify the service's url, key data field, and OData version if it is different from 2.

You can configure ODataStore as a standalone element (see OData for details), but this demo assigns ODataStore settings to the store field of the DataSource configuration object. If you follow the same pattern in your application, make sure to set the store's type property to "odata".

Backend API
@(Html.DevExtreme().DataGrid() .ShowBorders(true) .DataSource(d => d.OData() .Version(2) .Url("https://js.devexpress.com/Demos/DevAV/odata/Products") .Key("Product_ID") ) .DataSourceOptions(d => d.Select(new[] { "Product_ID", "Product_Name", "Product_Cost", "Product_Sale_Price", "Product_Retail_Price", "Product_Current_Inventory" }) .Filter("['Product_Current_Inventory', '>' , 0]") ) .Columns(columns => { columns.Add() .DataField("Product_ID"); columns.Add() .DataField("Product_Name") .Width(250); columns.Add() .Caption("Cost") .DataField("Product_Cost") .DataType(GridColumnDataType.Number) .Format(Format.Currency); columns.Add() .DataField("Product_Sale_Price") .Caption("Sale Price") .DataType(GridColumnDataType.Number) .Format(Format.Currency); columns.Add() .DataField("Product_Retail_Price") .Caption("Retail Price") .DataType(GridColumnDataType.Number) .Format(Format.Currency); columns.Add() .DataField("Product_Current_Inventory") .Caption("Inventory"); }) )
using DevExtreme.MVC.Demos.Models; using DevExtreme.MVC.Demos.Models.DataGrid; 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 SimpleArray() { return View(SampleData.SimpleArrayCustomers); } public ActionResult AjaxRequest() { return View(); } public ActionResult WebAPIService() { return View(); } public ActionResult ODataService() { return View(); } public ActionResult RecordPaging() { return View(); } public ActionResult VirtualScrolling() { return View(); } public ActionResult RemoteVirtualScrolling() { return View(); } public ActionResult HorizontalVirtualScrolling() { return View(); } public ActionResult InfiniteScrolling() { return View(); } public ActionResult RowEditingAndEditingEvents() { return View(); } public ActionResult BatchEditing() { return View(); } public ActionResult CellEditingAndEditingAPI() { return View(); } public ActionResult SignalRService() { return View(); } public ActionResult DataValidation() { return View(); } public ActionResult FormEditing() { return View(); } public ActionResult PopupEditing() { return View(); } public ActionResult CascadingLookups() { return View(); } public ActionResult RecordGrouping() { return View(); } public ActionResult RemoteGrouping() { return View(); } public ActionResult MultipleSorting() { return View(); } public ActionResult Filtering() { return View(); } public ActionResult FilteringAPI() { return View(); } public ActionResult FilterPanel() { return View(SampleData.OrdersWithCustomerInfo); } public ActionResult ColumnHeaderFilter() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult FocusedRow() { return View(); } public ActionResult RowSelection() { return View(SampleData.DataGridEmployees.Take(5)); } public ActionResult MultipleRecordSelectionModes() { return View(); } public ActionResult MultipleRecordSelectionAPI() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult DeferredSelection() { return View(); } public ActionResult ColumnReordering() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult ColumnsBasedOnADataSource() { return View(); } public ActionResult MultiRowHeadersBands() { return View(SampleData.CountriesPopulationAndGDP); } public ActionResult ColumnResizing() { return View(); } public ActionResult FixedAndStickyColumns() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult StatePersistence() { return View(SampleData.Orders); } public ActionResult Appearance() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult RightToLeftSupport() { return View(SampleData.EuropeanCountries); } public ActionResult CommandColumnCustomization() { return View(); } public ActionResult ColumnChooser() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult ColumnTemplate() { return View(SampleData.DataGridEmployees.Take(9)); } public ActionResult RowTemplate() { return View(SampleData.DataGridEmployees.Take(9)); } public ActionResult CellCustomization() { return View(SampleData.IntradayData); } public ActionResult Overview() { return View(); } public ActionResult GridSummaries() { return View(); } public ActionResult GroupSummaries() { return View(); } public ActionResult CustomSummaries() { return View(); } public ActionResult MasterDetailView() { return View(); } public ActionResult MasterDetailAPI() { return View(); } public ActionResult AdvancedMasterDetailView() { return View(); } public ActionResult ToolbarCustomization() { return View(SampleData.Orders.Take(12)); } public ActionResult ExcelJSExportImages() { return View(); } public ActionResult ExcelJSExportMultipleGrids() { return View(); } public ActionResult ExcelJSOverview() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult ExcelJSCellCustomization() { return View(); } public ActionResult ExcelJSHeaderAndFooter() { return View(SampleData.CountriesPopulationAndGDP); } public ActionResult PDFOverview() { return View(); } public ActionResult PDFCellCustomization() { return View(); } public ActionResult PDFHeaderAndFooter() { return View(SampleData.CountriesPopulationAndGDP); } public ActionResult PDFExportMultipleGrids() { return View(); } public ActionResult PDFExportImages() { return View(); } public ActionResult GridAdaptabilityOverview() { return View(SampleData.Orders); } public ActionResult GridColumnsHidingPriority() { return View(SampleData.Orders); } public ActionResult CollaborativeEditing() { return View(); } public ActionResult RealTimeUpdates() { return View(); } public ActionResult RecalculateWhileEditing() { return View(SampleData.Orders.Where(o => o.ID != 14).ToList()); } public ActionResult CRUDOperations() { return View(); } public ActionResult CustomizeKeyboardNavigation() { return View(); } public ActionResult KeyboardNavigation() { return View(); } public ActionResult CustomEditors() { return View(); } public ActionResult LocalReordering() { return View(); } public ActionResult RemoteReordering() { return View(); } public ActionResult DnDBetweenGrids() { return View(); } public ActionResult BatchUpdateRequest() { return View(); } public ActionResult EditStateManagement() { return View(); } public ActionResult CustomNewRecordPosition() { return View(); } } }

The DataSource configuration object allows you to sort, filter, group, and otherwise shape the store's data objects. This demo filters data and selects a limited number of fields.

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