Features

Data Binding

Data Binding

FlexSheet supports databinding like a grid.

Features

Data Binding

FlexSheet can be unbound, but it also supports databinding like a grid.
In bound mode, columns can be defined and data bound just like FlexGrid.

ID
Date
Country
Product
Amount
Active
1
1/25/2014
Japan
Doohickey
2,680.23
  • Sheet1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
using FlexSheetExplorer.Models;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Linq;
  
namespace FlexSheetExplorer.Controllers
{
    public partial class FlexSheetController : Controller
    {
        public static List<Sale> SALES = CustomerSale.GetData(50).ToList();
  
        public ActionResult DataBinding()
        {
            return View(SALES);
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@model IEnumerable<Sale>
  
@section Scripts{<script type="text/javascript" src="~/Scripts/flexSheet/dataBinding.js"></script>}
<div>
    <div class="copy">
        <h3>
            @Html.Raw(FlexSheetRes.DataBinding_Text2)
        </h3>
<p>@Html.Raw(FlexSheetRes.DataBinding_Text0)</p>
  
    </div>
    <div>
        <c1-flex-sheet class="flexSheet" id="boundSheet">
            <c1-bound-sheet>
                <c1-items-source source-collection="@Model"></c1-items-source>
            </c1-bound-sheet>
        </c1-flex-sheet>
    </div>
</div>
@section Summary{
<p>@Html.Raw(FlexSheetRes.DataBinding_Text1)</p>
  
}