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
Sep/14/2015
6:23 AM
Germany
268
8,210.41
96.77
1
Jan/15/2015
1:34 AM
Italy
39
3,523.37
3,808.16
2
Dec/11/2015
10:57 PM
Italy
546
15.54
1,129.98
3
Oct/05/2015
7:40 AM
Japan
238
7,852.65
3,786.34
4
Mar/18/2015
10:18 AM
Greece
221
6,108.19
4,934.10
5
Mar/25/2015
9:58 PM
Germany
532
5,341.47
3,752.56
6
May/18/2015
3:34 AM
Japan
571
7,542.64
3,933.07
7
Aug/13/2015
7:27 AM
UK
67
7,267.22
1,113.34
8
Sep/24/2015
4:43 PM
US
197
1,607.43
61.31
9
Oct/09/2015
12:26 AM
Greece
585
3,971.44
3,443.37
10
Feb/17/2015
10:56 AM
Greece
544
4,775.70
2,187.52
11
Sep/08/2015
10:25 AM
Japan
50
934.30
4,497.68
12
May/12/2015
1:43 AM
Greece
989
4,505.53
1,659.82
13
Nov/24/2015
4:03 PM
Italy
127
9,896.81
3,106.00
14
May/03/2015
11:07 PM
Greece
167
8,617.72
1,198.20

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)
}