Your search did not match any results.
DataGrid

Horizontal Virtual Scrolling

Documentation

Horizontal virtual scrolling improves the widget's rendering performance because the widget only renders columns that are in the viewpoint. To enable this feature, set the scrolling.columnRenderingMode option to "virtual".

@(Html.DevExtreme().DataGrid() .ID("grid") .Scrolling(scrolling => scrolling.ColumnRenderingMode(GridColumnRenderingMode.Virtual)) .Paging(paging => paging.Enabled(false)) .DataSource(d => d.WebApi().Controller("DataGridHorizontalScrolling")) .ColumnWidth(100) .ShowBorders(true) )
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 HorizontalVirtualScrolling() { return View(); } } }
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using DevExtreme.MVC.Demos.Models; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Net.Http; using System.Web.Http; using System.Dynamic; namespace DevExtreme.MVC.Demos.Controllers.ApiControllers { public class DataGridHorizontalScrollingController : ApiController { [HttpGet] public HttpResponseMessage Get(DataSourceLoadOptions loadOptions) { return Request.CreateResponse(DataSourceLoader.Load(GenerateData(50, 500), loadOptions)); } List<dynamic> GenerateData(int rowCount, int columnCount) { var items = new List<dynamic>(); for(int i = 0; i < rowCount; i++) { dynamic expando = new ExpandoObject(); var item = expando as IDictionary<string, object>; for(int j = 0; j < columnCount; j++) { item[string.Format("field{0}", j + 1)] = string.Format("{0}-{1}", i + 1, j + 1); } items.Add(expando); } return items; } } }
#grid { max-height: 440px; }