ComponentOne
Web API Explorer ASP.NET Web API Explorer

Wijmo5FlexGrid

Overview

This sample demonstrates how to export and import a wijmo5 flexgrid to excel file.

Features

Id
Date
Time
Country
Downloads
Sales
Expenses
Checked
0
Feb/20/2015
5:20 AM
Germany
884
5,524.58
2,599.15
1
Apr/20/2015
12:30 AM
Italy
49
7,928.89
1,446.50
2
Oct/24/2015
2:20 AM
Italy
864
9,674.12
3,809.42
3
Dec/01/2015
6:44 AM
Japan
895
4,203.70
2,635.87
4
Feb/04/2015
6:35 AM
Italy
663
5,854.36
3,052.11
5
May/06/2015
11:32 AM
Japan
752
1,294.02
4,247.43
6
May/17/2015
2:40 AM
UK
215
4,859.23
4,868.01
7
Oct/07/2015
8:08 AM
Italy
989
8,157.58
4,242.26
8
Aug/18/2015
7:20 PM
Greece
438
1,128.74
2,779.86
9
Mar/08/2015
5:24 AM
Germany
790
8,084.73
2,504.19
10
Jan/24/2015
2:24 AM
Germany
628
3,986.39
2,228.95
11
Sep/19/2015
6:31 PM
Germany
50
9,379.70
4,888.88
12
Oct/01/2015
1:53 PM
Japan
888
5,667.01
1,396.94
13
May/15/2015
5:07 AM
US
677
1,558.42
4,130.82
14
Oct/09/2015
7:50 AM
Germany
467
7,070.85
2,249.29

Settings


Export & Import
Export Name :           

Description

This sample demonstrates how to export and import a wijmo5 flexgrid 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
{
    public partial class Wijmo5FlexGridController : Controller
    {
        private readonly GridExportImportOptions _flexGridModel = new GridExportImportOptions
        {
            NeedExport = true,
            NeedImport = true,
            IncludeColumnHeaders = true
        };
  
        public IActionResult Index()
        {
            ViewBag.Options = _flexGridModel;
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@{
    GridExportImportOptions optionsModel = ViewBag.Options;
    ViewBag.DemoSettings = true;
}
  
<div id="@(optionsModel.ControlId)" style="height:300px"></div>
@section Settings{
    @Html.Partial("_FlexGridOptions", optionsModel)
}
<script>
    var grid = new wijmo.grid.FlexGrid('#@(optionsModel.ControlId)');
    initializeFlexGrid(grid);
</script>
@section Description{
    @Html.Raw(Wijmo5FlexGrid.Index_Text0)
}