Features

Virtual Scrolling

Virtual Scrolling

Features

Description

This sample shows how to make the MultiRow control work in virtual scrolling mode.

To enable this functionality, the DisableServerRead property should be set to false (default).
Then the InitialItemsCount property should be set to a number which is greater than 0.

using MultiRowExplorer.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MultiRowExplorer.Controllers
{
    public partial class MultiRowController : Controller
    {
        //
        // GET: /VirtualScrolling/

        public ActionResult VirtualScrolling()
        {
            return View(Sale.GetData(100000));
        }

    }
}
@model IEnumerable<Sale>

@(Html.C1().MultiRow<Sale>()
    .Id("virtualScrollingMultiRow")
    .Bind(bl => bl.InitialItemsCount(100).Bind(Model))
    .IsReadOnly(true)
    .LayoutDefinition(LayoutDefinitionsBuilders.Sales)
    .CssClass("multirow")
)

@section Description{
<p>@Html.Raw(Resources.MultiRowExplorer.VirtualScrolling_Text0)</p>

<p>@Html.Raw(Resources.MultiRowExplorer.VirtualScrolling_Text1)</p>

}