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 System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MvcExplorer.Controllers { public partial class FlexGridController : Controller { // // GET: /VirtualScrolling/ public ActionResult VirtualScrolling() { return View(Sale.GetData(100000)); } } }
VirtualScrolling.cshtml
@model IEnumerable<Sale> @(Html.C1().FlexGrid<Sale>() .Bind(bl => bl.InitialItemsCount(100).Bind(Model)) .IsReadOnly(true) .CssClass("grid") ) @section Description{ @Html.Raw(Resources.FlexGrid.VirtualScrolling_Text0) }
Documentation