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
Jan/23/2015
6:44 AM
Germany
27
5,381.19
2,827.81
1
Aug/09/2015
1:02 PM
Japan
748
2,396.63
4,626.52
2
Jul/09/2015
4:10 AM
UK
497
6,601.57
4,855.28
3
Apr/19/2015
3:12 PM
Japan
362
6,730.67
4,611.02
4
Sep/12/2015
10:02 AM
Germany
835
2,962.22
1,771.16
5
Sep/13/2015
11:43 AM
US
233
888.92
2,741.72
6
Sep/10/2015
4:52 AM
UK
730
8,139.99
1,406.98
7
Apr/14/2015
8:12 PM
Italy
769
4,491.03
977.09
8
Mar/13/2015
6:41 AM
Greece
945
7,712.52
3,070.42
9
Jun/04/2015
11:43 AM
US
190
8,123.93
197.80
10
Jul/18/2015
9:37 AM
Italy
197
7,810.31
2,984.11
11
Jan/01/2015
1:12 AM
Japan
899
9,633.27
2,476.25
12
Feb/25/2015
12:16 PM
Greece
979
572.67
868.70
13
Jun/02/2015
12:19 PM
Germany
623
4,034.92
4,306.12
14
Dec/20/2015
7:57 PM
UK
665
206.56
4,001.43

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
22
23
24
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.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 ActionResult Index()
        {
            ViewBag.Options = _flexGridModel;
            return View();
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
@using WebApiExplorer.Models
@{
    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(Resources.Wijmo5FlexGrid.Index_Text0)
}