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
Jul/13/2015
5:01 AM
Germany
815
8,153.51
4,510.86
1
Feb/01/2015
9:52 PM
US
429
281.11
2,196.73
2
May/07/2015
3:32 AM
Germany
252
5,444.06
2,709.29
3
Jan/15/2015
3:09 AM
Italy
383
7,716.98
2,098.57
4
Aug/24/2015
4:06 PM
Italy
483
2,685.45
169.12
5
Jan/11/2015
4:48 PM
Japan
915
3,168.55
4,957.60
6
Jan/22/2015
6:46 AM
Greece
396
4,943.27
91.83
7
Jun/01/2015
3:40 AM
US
652
6,151.73
486.03
8
Apr/06/2015
9:21 PM
Japan
546
963.19
2,541.98
9
Oct/02/2015
10:26 AM
Italy
346
3,525.93
4,424.88
10
Nov/16/2015
4:08 PM
UK
3
8,618.29
4,522.64
11
Jul/17/2015
1:57 PM
UK
604
874.28
2,449.90
12
Jan/10/2015
5:34 AM
Greece
409
4,085.07
2,736.13
13
Apr/12/2015
4:56 PM
Italy
832
7,145.63
854.48
14
Aug/12/2015
11:27 AM
Japan
482
2,229.87
3,932.69

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