Features

Cell Merging

Cell Merging

FlexSheet supports merging the selected cells into one cell.

Features

Cell Merging

FlexSheet supports merging the selected cells into one cell by invoking the mergeRange method.
If the selected cells contain a merged cell, the mergeRange method will un-merge the merged cell.
Otherwise, it merges the selected cells into one cell.

This differs from FlexGrid, which allows only content-driven cell merging.

using Microsoft.AspNetCore.Mvc;

namespace FlexSheetExplorer.Controllers
{
    public partial class FlexSheetController : Controller
    {
        public ActionResult CellMerging()
        {
            return View();
        }
    }
}
@section Scripts{
    <script type="text/javascript" src="~/Scripts/flexSheet/cellMerging.js"></script>
    <script type="text/javascript">
    c1.documentReady(function () {
        updateBtnTitle('@Html.Raw(FlexSheetRes.CellMerging_Text4)', '@Html.Raw(FlexSheetRes.CellMerging_Text3)');
    });
    </script>
}
<div>
    <div class="copy">
        <h3>@Html.Raw(FlexSheetRes.CellMerging_Text2)</h3>

        <p>@Html.Raw(FlexSheetRes.CellMerging_Text0)</p>

    </div>
    <button type="button" class="btn btn-default" onclick="mergeCells()" id="mergeBtn">@Html.Raw(FlexSheetRes.CellMerging_Text3)</button>
    <div>
        <c1-flex-sheet class="flexSheet" id="mergeSheet">
            <c1-unbound-sheet row-count="20" column-count="8"></c1-unbound-sheet>
        </c1-flex-sheet>
    </div>
</div>
@section Summary{
    <p>@Html.Raw(FlexSheetRes.CellMerging_Text1)</p>

}