using C1.Web.Mvc;
using C1.Web.Mvc.Serialization;
using Microsoft.AspNetCore.Mvc;
using WebApiExplorer.Models;
namespace WebApiExplorer.Controllers
{
public partial class MVCFlexGridController : Controller
{
private readonly GridExportImportOptions _flexGridVirtualScrollingModel = new GridExportImportOptions
{
NeedExport = true,
NeedImport = false,
IncludeColumnHeaders = true
};
public IActionResult VirtualScrolling()
{
ViewBag.Options = _flexGridVirtualScrollingModel;
return View();
}
public IActionResult VirtualScrolling_Bind([C1JsonRequest] CollectionViewRequest<Sale> requestData)
{
return this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(1000)));
}
}
}
@{
GridExportImportOptions optionsModel = ViewBag.Options;
ViewBag.DemoSettings = true;
}
<c1-flex-grid id="@optionsModel.ControlId" 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 Settings{
@await Html.PartialAsync("_FlexGridOptions", optionsModel)
}
@section Description{
<p>@Html.Raw(MVCFlexGrid.VirtualScrolling_Text0)</p>
}