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 _flexGridFrozenCellsModel = new GridExportImportOptions
{
NeedExport = true,
NeedImport = false,
IncludeColumnHeaders = true
};
public ActionResult FrozenCells()
{
ViewBag.Options = _flexGridFrozenCellsModel;
return View();
}
}
}
@using WebApiExplorer.Models
@{
GridExportImportOptions optionsModel = ViewBag.Options;
ViewBag.DemoSettings = true;
}
<div id="@(optionsModel.ControlId)" style="height:300px"></div>
<select id="frozenColumnMenu">
<option value=0>0</option>
<option value=1 selected>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4>4</option>
</select>
<select id="frozenRowMenu">
<option value=0>0</option>
<option value=1>1</option>
<option value=2 selected>2</option>
<option value=3>3</option>
<option value=4>4</option>
</select>
@section Settings{
@Html.Partial("_FlexGridOptions", optionsModel)
}
<script>
var grid = new wijmo.grid.FlexGrid('#@(optionsModel.ControlId)'), fcMenu = new wijmo.input.Menu('#frozenColumnMenu'), frMenu = new wijmo.input.Menu('#frozenRowMenu');
initializeFlexGrid(grid);
grid.frozenColumns = 1;
grid.frozenRows = 2;
fcMenu.itemClicked.addHandler(function (sender) {
grid.frozenColumns = parseInt(sender.selectedValue);
updateFCMenuHeader();
});
frMenu.itemClicked.addHandler(function (sender) {
grid.frozenRows = parseInt(sender.selectedValue);
updateFRMenuHeader();
});
updateFCMenuHeader();
updateFRMenuHeader();
function updateFCMenuHeader() {
fcMenu.header = '<b>@(Resources.Wijmo5FlexGrid.FrozenCells_FrozenColumns)</b> ' + fcMenu.text;
}
function updateFRMenuHeader() {
frMenu.header = '<b>@(Resources.Wijmo5FlexGrid.FrozenCells_FrozenRows)</b> ' + frMenu.text;
}
</script>
@section Description{
@Html.Raw(Resources.Wijmo5FlexGrid.FrozenCells_Text0)
}