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
Mar/03/2015
2:14 PM
UK
551
1,211.92
2,861.60
1
Feb/08/2015
12:14 AM
Italy
391
413.19
499.45
2
Aug/25/2015
10:27 AM
Greece
598
2,754.63
4,756.89
3
Nov/22/2015
8:03 AM
Italy
797
5,713.42
491.04
4
Apr/03/2015
2:31 AM
Germany
428
6,323.95
3,083.91
5
Oct/15/2015
5:56 PM
UK
258
120.79
1,045.48
6
Oct/01/2015
2:05 PM
UK
80
8,830.64
3,781.07
7
Jun/21/2015
4:05 PM
UK
269
1,500.42
1,487.85
8
Mar/03/2015
12:48 PM
Italy
987
6,855.39
2,243.71
9
May/01/2015
1:37 PM
Greece
915
1,430.34
4,670.18
10
Jan/20/2015
9:10 PM
Germany
343
1,549.46
448.10
11
Dec/11/2015
1:46 PM
UK
937
5,698.30
3,653.43
12
Apr/03/2015
4:59 PM
Italy
165
7,012.32
971.49
13
Sep/19/2015
9:01 PM
Italy
635
4,998.45
2,218.68
14
Jan/05/2015
9:54 AM
Italy
361
5,015.86
571.25

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