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
Oct/11/2015
2:57 AM
US
18
1,812.09
679.02
1
Jan/20/2015
1:32 PM
UK
967
9,299.84
1,742.95
2
Jul/13/2015
6:37 PM
Germany
946
4,087.45
2,534.59
3
Feb/04/2015
3:04 PM
Germany
802
711.71
1,396.22
4
Mar/17/2015
1:16 AM
US
990
8,828.57
4,621.97
5
Oct/21/2015
5:26 PM
Japan
868
5,690.21
1,661.00
6
Aug/10/2015
1:05 PM
US
117
6,929.87
2,776.88
7
Apr/04/2015
3:11 AM
Greece
501
9,050.20
4,598.41
8
Sep/19/2015
12:08 AM
Italy
463
3,299.45
1,677.49
9
Oct/12/2015
4:25 PM
Italy
832
5,497.24
1,718.68
10
Apr/04/2015
12:08 AM
Germany
115
5,529.40
3,433.18
11
Mar/05/2015
9:10 PM
Italy
316
9.65
2,153.12
12
Jan/14/2015
4:39 AM
Japan
16
1,410.87
216.01
13
Feb/16/2015
1:40 PM
UK
183
7,076.37
4,019.86
14
Jun/17/2015
9:33 AM
Italy
9
8,259.81
3,803.54

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