Frozen Rows and Columns

You can freeze rows and columns by setting the grid's frozenRows and frozenColumns properties.

Frozen cells do not scroll but are selectable/editable like regular cells:

Id
Country
Downloads
Sales
Expenses
Num1
Num2
Num3
Num4
Num5
Num6
Num7
Num8
Num9
Num10
0
US
9,044
4,566.75
2,247.93
2,837.08
743.79
2,688.14
2,350.07
923.80
3,584.57
3,084.65
540.01
2,319.84
2,511.95
1
Germany
12,517
3,423.39
2,850.15
1,136.85
4,825.65
547.62
3,146.71
4,536.96
4,258.96
1,758.02
3,569.95
2,719.74
38.37
2
UK
2,657
2,607.12
3,510.71
3,457.82
868.42
4,806.97
2,593.15
906.66
3,749.80
4,767.67
3,656.60
4,317.43
656.75
3
Japan
14,326
1,164.16
3,399.92
200.90
1,853.24
2,099.72
2,748.64
2,412.61
4,536.98
283.00
2,261.84
367.34
3,591.52
4
Italy
15,858
9,085.03
2,340.50
3,304.63
4,911.85
3,213.74
2,849.42
1,021.70
266.11
1,655.51
4,494.47
4,578.49
2,008.20
5
Greece
14,000
3,317.36
4,681.57
751.62
4,176.45
2,599.54
3,668.87
1,547.23
199.14
2,134.14
3,463.60
3,785.59
4,128.04
6
US
19,091
7,375.24
4,689.05
2,935.05
300.41
2,259.84
4,494.15
3,295.70
1,657.37
4,534.25
3,643.17
4,435.06
2,323.85
7
Germany
15,063
928.47
2,432.09
954.96
2,599.68
155.39
2,999.59
2,931.65
2,914.77
251.23
4,118.82
4,485.93
2,033.56
8
UK
12,371
7,528.49
4,662.23
2,273.05
2,025.79
3,452.29
3,137.66
2,805.63
4,863.03
1,188.42
98.32
40.07
2,470.13
9
Japan
16,196
5,487.92
900.52
3,091.32
4,475.60
2,822.64
3,994.25
423.03
3,275.83
3,821.59
3,192.51
1,075.61
1,822.67
10
Italy
2,571
7,609.66
383.90
219.75
2,532.76
404.67
3,970.59
1,626.74
3,541.09
4,416.23
1,459.23
357.09
3,665.63
11
Greece
10,839
3,994.10
4,510.55
2,944.97
4,418.78
3,745.93
3,993.67
1,164.44
2,397.63
578.97
4,319.27
3,298.02
70.74
12
US
8,131
37.19
2,103.22
2,649.18
2,935.49
2,843.19
2,961.50
2,451.66
1,877.00
1,891.24
3,460.89
4,367.74
2,172.39
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
33
34
35
36
37
38
// This file locates: "Scripts/Lesson/C1FlexGrid/ColumnsFreezing.js".
c1.documentReady(function () {
    // generate some random data
    var countries = 'US,Germany,UK,Japan,Italy,Greece'.split(','),
        data = [];
    for (var i = 0; i < 200; i++) {
        data.push({
            id: i,
            country: countries[i % countries.length],
            downloads: Math.round(Math.random() * 20000),
            sales: Math.random() * 10000,
            expenses: Math.random() * 5000,
            num1: Math.random() * 5000,
            num2: Math.random() * 5000,
            num3: Math.random() * 5000,
            num4: Math.random() * 5000,
            num5: Math.random() * 5000,
            num6: Math.random() * 5000,
            num7: Math.random() * 5000,
            num8: Math.random() * 5000,
            num9: Math.random() * 5000,
            num10: Math.random() * 5000,
        });
    }
 
    var theGrid = wijmo.Control.getControl('#theGrid');
    theGrid.itemsSource = data;
    theGrid.frozenRows = 2;
    theGrid.frozenColumns = 1;
 
    // toggle frozen rows
    document.getElementById('btnFreezeRows').addEventListener('click', function () {
        theGrid.frozenRows = theGrid.frozenRows > 0 ? 0 : 2;
    });
    document.getElementById('btnFreezeCols').addEventListener('click', function () {
        theGrid.frozenColumns = theGrid.frozenColumns > 0 ? 0 : 1;
    });
});
1
2
3
4
5
6
// This file locates: "Content/css/Lesson/C1FlexGrid/ColumnsFreezing.css".
/* style frozen cells */
.wj-cell.wj-frozen:not(.wj-header):not(.wj-group):not(.wj-state-selected):not(.wj-state-multi-selected),
.wj-cell.wj-frozen.wj-alt:not(.wj-header):not(.wj-group):not(.wj-state-selected):not(.wj-state-multi-selected) {
  background: #fffff5
}
1
2
3
4
5
6
7
8
9
10
11
12
13
using System.Web.Mvc;
 
namespace LearnMvcClient.Controllers
{
    public partial class C1FlexGridController : Controller
    {
        // GET: ColumnsFreezing
        public ActionResult ColumnsFreezing()
        {
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<h1>
    @Html.Raw(Resources.C1FlexGrid.ColumnsFreezing_Title)
</h1>
<p>
    @Html.Raw(Resources.C1FlexGrid.ColumnsFreezing_Text1)
</p>
<p>
    @Html.Raw(Resources.C1FlexGrid.ColumnsFreezing_Text2)
</p>
@Html.C1().FlexGrid().Id("theGrid").Height(250)
 
<button id="btnFreezeRows" class="btn btn-default">
    @Html.Raw(Resources.C1FlexGrid.ColumnsFreezing_Text3)
</button>
<button id="btnFreezeCols" class="btn btn-default">
    @Html.Raw(Resources.C1FlexGrid.ColumnsFreezing_Text4)
</button>