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/09/2015
7:52 AM
UK
130
3,309.79
1,079.12
1
May/24/2015
3:39 AM
Italy
259
6,492.58
1,092.72
2
Oct/21/2015
11:59 PM
UK
417
2,808.87
2,956.74
3
Jan/16/2015
7:04 AM
Germany
286
5,905.78
40.17
4
Jan/10/2015
11:37 PM
UK
91
701.88
112.50
5
Aug/14/2015
11:43 AM
US
793
9,273.81
2,827.34
6
May/15/2015
6:40 PM
UK
146
3,095.63
4,822.33
7
Nov/05/2015
10:22 PM
Japan
336
6,602.31
2,651.90
8
Dec/08/2015
5:17 PM
Greece
198
9,764.75
4,531.25
9
Feb/20/2015
11:42 AM
Italy
709
3,221.29
830.49
10
Jun/23/2015
6:22 AM
Japan
695
2,511.00
4,277.25
11
Oct/11/2015
12:17 AM
US
207
4,559.26
4,743.50
12
Oct/07/2015
12:22 PM
Italy
290
4,486.12
2,357.88
13
Jan/19/2015
2:09 PM
US
48
7,618.71
1,516.47
14
Jul/22/2015
12:29 PM
Germany
229
7,837.71
289.33

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