Your search did not match any results.

Data Grid - Remote Grouping

Remote (server-side) operations can boost the DataGrid's performance on large datasets. In this demo, the DataGrid works with a million records seamlessly because they are processed on the server.

To notify the DataGrid that it works with a pre-processed dataset, set the remoteOperations property to true.

Backend API
@(Html.DevExtreme().DataGrid<DevExtreme.MVC.Demos.Models.DataService.Sale>() .ID("gridContainer") .DataSource(d => d.RemoteController() .LoadUrl("https://js.devexpress.com/Demos/WidgetsGalleryDataService/api/Sales") .Key("Id") ) .RemoteOperations(ro => ro.GroupPaging(true)) .Scrolling(s => s .Mode(GridScrollingMode.Virtual) ) .GroupPanel(groupPanel => groupPanel.Visible(true)) .Grouping(grouping => grouping.AutoExpandAll(false)) .WordWrapEnabled(true) .Width("100%") .ShowBorders(true) .Columns(columns => { columns.AddFor(m => m.Id) .Width(75); columns.AddFor(m => m.ProductSubcategoryName) .Width(150); columns.AddFor(m => m.StoreName) .GroupIndex(0) .Width(150); columns.AddFor(m => m.ProductCategoryName) .GroupIndex(1) .Width(120); columns.AddFor(m => m.ProductName); columns.AddFor(m => m.DateKey) .Format("yyyy-MM-dd") .Width(100); columns.AddFor(m => m.SalesAmount) .Format("currency") .HeaderFilter(h => h.GroupInterval(1000)) .Width(100); }) .Summary(s => s.GroupItems(items => { items.AddFor(m => m.Id) .SummaryType(SummaryType.Count); })) )
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 RemoteGrouping() { return View(); } } }
using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace DevExtreme.MVC.Demos.Models.DataService { public partial class Sale { [Key] public int Id { get; set; } [Display(Name = "Category")] public string ProductCategoryName { get; set; } [Display(Name = "Subcategory")] public string ProductSubcategoryName { get; set; } [Display(Name = "Product")] public string ProductName { get; set; } public decimal UnitPrice { get; set; } [Display(Name = "Quantity")] public int SalesQuantity { get; set; } [Display(Name = "Amount")] public decimal SalesAmount { get; set; } [Display(Name = "Date")] public DateTime DateKey { get; set; } [Display(Name = "Store")] public string StoreName { get; set; } } }
#gridContainer { height: 420px; width: 100%; }

You can also specify properties that allow the DataGrid to load data on demand to reduce the amount of transmitted data. Set the grouping.autoExpandAll property to false to collapse all the groups at startup. Data for each group is loaded only when the user expands the group. Enable the "virtual" scrolling.mode to load only those records that come into the viewport when the grid is scrolled vertically.

The DataGrid communicates with the server according to a protocol. Refer to the Server-Side Data Processing article for information on it.

NOTE

The data source in this demo is configured to return only 1000 records per request.