FlexGrid
Column Pinning
AllowPinning property allows to add pin icons to the column headers and clicking the icons toggles the column's frozen state
Features
ID
Start
End
Country
Product
Color
Amount
1
1/25/2025
1/25/2025
German
Gadget
Green
581.61
2
2/25/2025
2/25/2025
Italy
Gadget
Green
-4,673.75
ID
Start
End
Country
Product
Color
Amount
0
Settings
Description
AllowPinning property allows to add pin icons to the column headers and clicking the icons toggles the column's frozen state
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | using MvcExplorer.Models; using System.Collections.Generic; using System.Web.Mvc; namespace MvcExplorer.Controllers { public partial class FlexGridController : Controller { private readonly ControlOptions _columnPinningDataModel = new ControlOptions { Options = new OptionDictionary { { "Pinning Type" , new OptionItem {Values = new List< string > { "None" , "SingleColumn" , "ColumnRange" , "Both" }, CurrentValue = "SingleColumn" }} } }; public ActionResult ColumnPinning(FormCollection collection) { IValueProvider data = collection; _columnPinningDataModel.LoadPostData(data); var model = Sale.GetData(500); ViewBag.DemoOptions = _columnPinningDataModel; return View(model); } } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | @using C1.Web.Mvc.Grid @model IEnumerable< Sale > @ { ControlOptions optionsModel = ViewBag.DemoOptions; ViewBag.DemoSettings = true ; } @ (Html.C1().FlexGrid< Sale >() .Id( "ovFlexGrid" ) .AutoGenerateColumns( true ) .CssClass( "grid" ) .IsReadOnly( true ) .Bind(bl => bl.Bind(Model)) .PinningType((PinningType)Enum.Parse( typeof (PinningType), optionsModel.Options[ "Pinning Type" ].CurrentValue)) .Width( "900px" ) ) @section Settings{ @Html .Partial( "_OptionsMenu" , optionsModel) } @section Summary{ < p > @Html .Raw(Resources.FlexGrid.AllowPinning_Text0)</ p > } @section Description{ @Html .Raw(Resources.FlexGrid.AllowPinning_Text0) } |