ASP.NET MVC Controls | ComponentOne
Working with Controls / FlexSheet / Work with FlexSheet / JSON Loading and Saving on Client-side
In This Topic
    JSON Loading and Saving on Client-side
    In This Topic

    FlexSheet supports Json loading and saving on the client side. You can easily load data from a json string in FlexSheet control, and even save the FlexSheet data in Json string. The control uses Workbook object model to accomplish this.

    The below code examples demonstrate how to use workbook object model to load Json string into FlexSheet control.

    In Code


    Copy Code
    public class JsonLoadController : Controller
        public static List<Sale> SALES = Sale.GetData(15).ToList();
        // GET: Json
        public ActionResult JsonIndex()
            return View(SALES);


    Copy Code
        var flex, jsonString;
        c1.mvc.Utils.documentReady(function () {
            flex = wijmo.Control.getControl('#jsonLoadSheet');
        function SaveToJson() {
            var workBook = flex.saveToWorkbookOM();
            jsonString = JSON.stringify(workBook);
        function loadJSON() {
            var workBook = JSON.parse(jsonString);
        <button class="btn btn-default" onclick="SaveToJson()">Save to Json</button>
        <button class="btn btn-default" onclick="loadJSON()">Load Json</button>
        <br /><br />
            .AddBoundSheet(sheet =>
                sheet.Bind(cv =>

    Back to Top

    See Also