FlexGrid
Virtual Scrolling
Features
Sample
Description
This sample shows how to make grid work in virtual scrolling mode. To enable this functionality, the DisableServerRead property should be false(default). Then the InitialItemsCount property should be set a number which is greater than 0.
Source
VirtualScrollingController.cs
using MvcExplorer.Models; using Microsoft.AspNetCore.Mvc; using C1.Web.Mvc; using C1.Web.Mvc.Serialization; namespace MvcExplorer.Controllers { public partial class FlexGridController : Controller { // // GET: /VirtualScrolling/ public ActionResult VirtualScrolling() { return View(); } public ActionResult VirtualScrolling_Bind([C1JsonRequest] CollectionViewRequest<Sale> requestData) { return this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(100000))); } } }
VirtualScrolling.cshtml
<c1-flex-grid is-read-only="true" class="grid"> <c1-items-source initial-items-count="100" read-action-url="@Url.Action("VirtualScrolling_Bind")"></c1-items-source> </c1-flex-grid> @section Description{ @Html.Raw(FlexGridRes.VirtualScrolling_Text0) }
Documentation