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/21/2015
3:04 PM
Germany
897
6,534.52
673.52
1
Jan/24/2015
5:09 AM
Japan
890
8,617.22
4,821.84
2
Aug/01/2015
3:37 PM
Greece
492
339.46
1,781.84
3
Feb/22/2015
4:37 PM
Italy
619
9,750.79
538.00
4
Nov/06/2015
1:55 AM
Japan
318
6,429.23
3,131.83
5
Dec/16/2015
2:55 AM
Greece
639
6,932.60
4,731.40
6
Apr/11/2015
8:15 AM
US
303
4,682.83
669.29
7
Sep/11/2015
3:48 PM
Italy
353
2,676.54
3,597.34
8
Aug/04/2015
1:25 PM
Japan
953
8,429.74
662.68
9
Jul/10/2015
8:00 AM
US
897
1,180.45
4,645.71
10
Jan/20/2015
9:07 PM
Greece
46
622.25
3,668.29
11
Jun/08/2015
7:44 PM
US
498
4,334.63
3,195.10
12
Jan/16/2015
9:47 AM
Italy
247
3,853.38
4,438.64
13
Feb/10/2015
4:59 AM
Germany
590
971.67
1,957.57
14
Dec/24/2015
1:47 PM
Japan
52
9,197.77
3,392.20

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