Your search did not match any results.

OData Service

Documentation

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".

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.

Backend API
@(Html.DevExtreme().DataGrid() .ShowBorders(true) .DataSource(d => d.OData() .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(); } 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 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 ColumnCustomization() { 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 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 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 ExportToExcel() { return View(SampleData.DataGridEmployees.Take(10)); } public ActionResult ExcelCellCustomization() { return View(SampleData.Orders); } public ActionResult ExcelJS() { return View(SampleData.Orders); } 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 ExportToPDF() { 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(); } } }