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/14/2015
3:45 AM
US
780
4,494.77
2,449.56
1
Feb/19/2015
6:01 PM
UK
644
4,802.72
3,851.66
2
May/19/2015
5:41 PM
Japan
278
8,032.77
314.25
3
Dec/16/2015
11:24 AM
US
614
5,419.01
4,741.91
4
May/03/2015
5:05 AM
Germany
909
2,302.91
3,303.55
5
Jan/22/2015
7:47 AM
UK
56
7,149.09
1.63
6
Dec/21/2015
11:04 PM
US
136
4,686.82
3,598.92
7
Oct/06/2015
8:50 PM
Greece
155
2,926.72
652.92
8
Nov/15/2015
6:35 PM
Germany
556
9,469.20
2,756.81
9
Jun/13/2015
4:57 PM
UK
700
8,346.51
2,709.98
10
May/04/2015
11:40 PM
Germany
297
6,952.31
4,736.81
11
May/17/2015
4:51 PM
Germany
593
7,759.03
710.26
12
Sep/14/2015
8:13 AM
Italy
759
1,638.81
4,021.18
13
Jan/12/2015
10:42 AM
Germany
374
7,353.09
1,348.87
14
May/05/2015
1:21 PM
Germany
954
6,354.66
2,709.01

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