ComponentOne
Web API Explorer ASP.NET Web API Explorer

Wijmo5FlexGrid

Frozen Cells

This sample demonstrates how to export a wijmo5 flexgrid with frozen cells to excel file.

Features

Id
Date
Time
Country
Downloads
Sales
Expenses
Checked
0
May/12/2015
7:33 AM
Italy
552
4,558.18
1,828.67
1
Feb/12/2015
8:25 AM
Japan
742
8,556.36
3,482.17
2
Sep/06/2015
4:04 AM
Germany
829
8,554.94
1,712.15
3
Oct/08/2015
7:43 AM
Italy
13
1,478.06
798.84
4
Dec/10/2015
3:36 AM
Germany
150
2,048.25
4,369.02
5
Aug/03/2015
4:14 PM
US
820
7,236.36
803.77
6
Aug/06/2015
6:21 AM
Germany
475
2,774.77
264.98
7
Aug/05/2015
12:08 PM
US
335
2,584.63
3,940.50
8
Nov/07/2015
4:15 AM
Japan
465
564.80
2,915.07
9
Oct/06/2015
10:46 PM
Japan
461
8,834.87
189.69
10
Dec/16/2015
7:43 AM
UK
535
8,118.23
4,359.90
11
Mar/05/2015
4:04 AM
Germany
369
9,125.62
4,558.53
12
Jun/03/2015
4:32 AM
UK
823
5,788.78
1,275.14
13
Jun/17/2015
9:56 PM
Japan
656
294.84
3,949.80
14
Sep/09/2015
4:33 PM
US
331
2,509.13
109.81

Settings


Export
Export Name :

Description

This sample demonstrates how to export a wijmo5 flexgrid with frozen cells to excel file.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using Microsoft.AspNetCore.Mvc;
using WebApiExplorer.Models;
  
namespace WebApiExplorer.Controllers.Wijmo5FlexGrid
{
    public partial class Wijmo5FlexGridController : Controller
    {
        private readonly GridExportImportOptions _flexGridFrozenCellsModel = new GridExportImportOptions
        {
            NeedExport = true,
            NeedImport = false,
            IncludeColumnHeaders = true
        };
  
        public IActionResult FrozenCells()
        {
            ViewBag.Options = _flexGridFrozenCellsModel;
            return View();
        }
    }
}
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@{
    GridExportImportOptions optionsModel = ViewBag.Options;
    ViewBag.DemoSettings = true;
}
  
<div id="@(optionsModel.ControlId)" style="height:300px"></div>
  
<select id="frozenColumnMenu">
    <option value=0>0</option>
    <option value=1 selected>1</option>
    <option value=2>2</option>
    <option value=3>3</option>
    <option value=4>4</option>
</select>
  
<select id="frozenRowMenu">
    <option value=0>0</option>
    <option value=1>1</option>
    <option value=2 selected>2</option>
    <option value=3>3</option>
    <option value=4>4</option>
</select>
  
@section Settings{
    @Html.Partial("_FlexGridOptions", optionsModel)
}
<script>
    var grid = new wijmo.grid.FlexGrid('#@(optionsModel.ControlId)'), fcMenu = new wijmo.input.Menu('#frozenColumnMenu'), frMenu = new wijmo.input.Menu('#frozenRowMenu');
    initializeFlexGrid(grid);
    grid.frozenColumns = 1;
    grid.frozenRows = 2;
  
    fcMenu.itemClicked.addHandler(function (sender) {
        grid.frozenColumns = parseInt(sender.selectedValue);
        updateFCMenuHeader();
    });
  
    frMenu.itemClicked.addHandler(function (sender) {
        grid.frozenRows = parseInt(sender.selectedValue);
        updateFRMenuHeader();
    });
  
    updateFCMenuHeader();
    updateFRMenuHeader();
  
    function updateFCMenuHeader() {
        fcMenu.header = '<b>@(Wijmo5FlexGrid.FrozenCells_FrozenColumns)</b> ' + fcMenu.text;
    }
  
    function updateFRMenuHeader() {
        frMenu.header = '<b>@(Wijmo5FlexGrid.FrozenCells_FrozenRows)</b> ' + frMenu.text;
    }
  
</script>
@section Description{
    @Html.Raw(Wijmo5FlexGrid.FrozenCells_Text0)
}