FlexGrid
Frozen Cells
This view shows the FlexGrid control's frozen cells features.
Features
ID
Start
End
Country
Product
Color
Amount
Amount2
Discount
Active
1
Jan 25 25
00:00
German
Gadget
Green
$581.61
$1,030.17
14%
2
Feb 25 25
01:30
Italy
Gadget
Green
($4,673.75)
$3,499.71
13%
2
Feb 25 25
01:30
Italy
Gadget
Green
($4,673.75)
$3,499.71
13%
3
Mar 25 25
02:00
China
Gadget
Black
($2,265.49)
$4,535.49
20%
ID
Start
End
Country
Product
Color
Amount
Amount2
Discount
Active
0
Settings
Frozen Columns: 1
Frozen Rows: 2
Description
This view shows the FlexGrid control's frozen cells features.
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 29 30 31 32 | using System.Collections.Generic; using System.Web.Mvc; using MvcExplorer.Models; using C1.Web.Mvc; 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(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; } } } |
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 29 30 | @using C1.Web.Mvc.Grid @model IEnumerable< Sale > @ { ClientSettingsModel demoSettingsModel = ViewBag.DemoSettingsModel; } @ (Html.C1().FlexGrid< Sale >().Id(demoSettingsModel.ControlId) .AutoGenerateColumns( false ) .IsReadOnly( true ) .Bind(Model) .CssClass( "grid" ) .Columns(columns => { columns.Add(column => column.Binding( "ID" )); columns.Add(column => column.Binding( "Start" ).Format( "MMM d yy" )); columns.Add(column => column.Binding( "End" ).Format( "HH:mm" )); columns.Add(column => column.Binding( "Country" )); columns.Add(column => column.Binding( "Product" )); columns.Add(column => column.Binding( "Color" )); columns.Add(column => column.Binding( "Amount" ).Format( "c" )); columns.Add(column => column.Binding( "Amount2" ).Format( "c" )); columns.Add(column => column.Binding( "Discount" ).Format( "p0" )); columns.Add(column => column.Binding( "Active" )); }) .FrozenColumns(1) .FrozenRows(2) ) @section Description{ @Html .Raw(Resources.FlexGrid.FrozenCells_Text0) } |