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
Apr/20/2015
3:24 AM
US
263
6,671.77
2,444.12
1
Feb/03/2015
1:30 AM
US
627
3,010.29
1,805.04
2
May/02/2015
2:14 PM
US
876
4,100.83
1,241.30
3
Jan/01/2015
12:07 PM
Japan
427
1,916.47
1,877.40
4
Dec/10/2015
9:06 PM
UK
932
9,960.77
132.57
5
Dec/04/2015
11:52 PM
Greece
160
5,877.70
853.90
6
Dec/24/2015
10:25 PM
Germany
409
4,248.97
1,734.31
7
Aug/22/2015
11:04 AM
Japan
911
3,790.95
2,146.13
8
Jun/18/2015
6:10 AM
US
423
361.65
1,721.86
9
Jul/01/2015
5:00 PM
UK
72
3,510.83
869.81
10
Dec/05/2015
12:49 AM
Italy
90
2,877.13
4,142.42
11
Mar/20/2015
3:38 PM
US
610
9,331.32
4,825.56
12
Feb/04/2015
4:19 AM
US
769
7,338.44
4,164.48
13
Jan/25/2015
12:25 PM
US
788
2,675.04
3,699.18
14
Oct/16/2015
8:58 PM
UK
623
9,299.14
361.49

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