FlexGrid
固定セル
機能
サンプル
設定
説明
このビューは、FlexGrid コントロールの固定セル機能を示します。
ソース
FrozenCellsController.cs
using C1.Web.Mvc; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using MvcExplorer.Models; using C1.Web.Mvc.Serialization; namespace MvcExplorer.Controllers { public partial class FlexGridController : Controller { public ActionResult FrozenCells() { ViewBag.DemoSettings = true; ViewBag.DemoSettingsModel = new ClientSettingsModel { Settings = CreateSettings() }; return View(); } public ActionResult FrozenCells_Bind([C1JsonRequest] CollectionViewRequest<Sale> requestData) { return this.C1Json(CollectionViewHelper.Read(requestData, Sale.GetData(500))); } private static IDictionary<string, object[]> CreateSettings() { var settings = new Dictionary<string, object[]> { {"FrozenColumns", new object[]{1, 0, 2, 3}}, {"FrozenRows", new object[]{2, 0, 1, 3, 4, 5}} }; return settings; } } }
FrozenCells.cshtml
@model IEnumerable<Sale> @{ ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel; } <c1-flex-grid id="@demoSettingsModel.ControlId" auto-generate-columns="false" is-read-only="true" class="grid" frozen-columns="1" frozen-rows="2"> <c1-flex-grid-column binding="ID"></c1-flex-grid-column> <c1-flex-grid-column binding="Start" format="MMM d yy"></c1-flex-grid-column> <c1-flex-grid-column binding="End" format="HH:mm"></c1-flex-grid-column> <c1-flex-grid-column binding="Country"></c1-flex-grid-column> <c1-flex-grid-column binding="Product"></c1-flex-grid-column> <c1-flex-grid-column binding="Color"></c1-flex-grid-column> <c1-flex-grid-column binding="Amount" format="c"></c1-flex-grid-column> <c1-flex-grid-column binding="Amount2" format="c"></c1-flex-grid-column> <c1-flex-grid-column binding="Discount" format="p0"></c1-flex-grid-column> <c1-flex-grid-column binding="Active"></c1-flex-grid-column> <c1-items-source read-action-url="@Url.Action("FrozenCells_Bind")"></c1-items-source> </c1-flex-grid> @section Description{ @Html.Raw(FlexGridRes.FrozenCells_Text0) }
マニュアル