{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-protection",
  "framework": "angular",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "protection",
  "dependencies": [
    "@syncfusion/ej2-angular-spreadsheet"
  ],
  "description": "Spreadsheet sample demonstrating worksheet and cell protection settings.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 2 (v34.1.29)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": true,
    "platformIndex": "https://ai.syncfusion.com/angular/llms.txt",
    "skillPack": "syncfusion/angular-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/angular/spreadsheet-editor-protection.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-protection/protect-sheet.component.ts",
      "content": "import { Component, ViewEncapsulation, Inject, ViewChild } from '@angular/core';\nimport { protectSheetData } from '../data';\nimport { SpreadsheetComponent, CellRenderEventArgs, SpreadsheetModule } from '@syncfusion/ej2-angular-spreadsheet';\n/**\n * Protect sheet Spreadsheet Controller\n */\n@Component({\n    selector: 'control-content',\n    templateUrl: 'protect-sheet.html',\n    encapsulation: ViewEncapsulation.None,\n    standalone: true,\n    imports: [ SpreadsheetModule]\n})\n\nexport class ProtectSheetComponent {\n    @ViewChild('spreadsheet')\n    spreadsheetObj!: SpreadsheetComponent;\n    data: Object[] = protectSheetData();\n    public openUrl = 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/open';\n    public saveUrl = 'https://document.syncfusion.com/web-services/spreadsheet-editor/api/spreadsheet/save';\n    created() {\n        // Applied number formatting to a range\n        this.spreadsheetObj.numberFormat('$#,##0.00', 'EMI Schedule!C2:F13');\n        this.spreadsheetObj.numberFormat('m/d/yyyy', 'EMI Calculator!C5:C5');\n        this.spreadsheetObj.numberFormat('m/d/yyyy', 'EMI Schedule!B2:B13');\n    }\n    beforeCellRender(args: CellRenderEventArgs) {\n        // Merged cells using custom code\n        if (this.spreadsheetObj.sheets[this.spreadsheetObj.activeSheetIndex].name === 'EMI Calculator' && args.address === 'B1') {\n            (args.element as HTMLTableCellElement).colSpan = 2;\n        }\n    }\n}\n"
    },
    {
      "target": "src/components/spreadsheet-editor-protection/protect-sheet.html",
      "content": "\n<div class=\"control-section\">\n    <ejs-spreadsheet #spreadsheet password=\"spreadsheet\" [openUrl]=\"openUrl\" [saveUrl]=\"saveUrl\" (created)=\"created()\" (beforeCellRender)=\"beforeCellRender($event)\">\n        <e-sheets>\n            <e-sheet name=\"EMI Calculator\" [isProtected]=\"true\">\n                <e-rows>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Home Loan Calculator\" [style]=\"{ textAlign: 'center', fontWeight: 'bold' }\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Loan Amount:\"></e-cell>\n                            <e-cell value=\"100000\" format=\"$#,##0.00\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Interest Rate:\"></e-cell>\n                            <e-cell value=\"0.08\" format=\"0.00%\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Periods (terms in year):\"></e-cell>\n                            <e-cell value=\"1\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Start Date:\"></e-cell>\n                            <e-cell value=\"03-03-2020\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Loan EMI:\"></e-cell>\n                            <e-cell value=\"8698.84\" format=\"$#,##0.00\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Number of Payments:\"></e-cell>\n                            <e-cell value=\"12\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Total Repayment Amount:\"></e-cell>\n                            <e-cell value=\"104386.11\" format=\"$#,##0.00\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [index]=\"1\" value=\"Total Interest Amount:\"></e-cell>\n                            <e-cell value=\"4386.11\" format=\"$#,##0.00\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                </e-rows>\n                <e-columns>\n                    <e-column [index]=\"1\" [width]=190></e-column>\n                    <e-column [width]=100></e-column>\n                </e-columns>\n            </e-sheet>\n            <e-sheet name=\"EMI Schedule\" [isProtected]=\"true\">\n                <e-ranges>\n                    <e-range [dataSource]=\"data\"></e-range>\n                </e-ranges>\n                <e-rows>\n                    <e-row>\n                        <e-cells>\n                            <e-cell [style]=\"{ textAlign: 'center', fontWeight: 'bold' }\">\n                            </e-cell>\n                            <e-cell [style]=\"{ textAlign: 'center', fontWeight: 'bold' }\">\n                            </e-cell>\n                            <e-cell [style]=\"{ textAlign: 'center', fontWeight: 'bold' }\">\n                            </e-cell>\n                            <e-cell [style]=\"{ textAlign: 'center', fontWeight: 'bold' }\">\n                            </e-cell>\n                            <e-cell [style]=\"{ textAlign: 'center', fontWeight: 'bold' }\">\n                            </e-cell>\n                            <e-cell [style]=\"{ textAlign: 'center', fontWeight: 'bold' }\">\n                            </e-cell>\n                        </e-cells>\n                    </e-row>\n                </e-rows>\n                <e-columns>\n                    <e-column [index]=\"1\" [width]=110></e-column>\n                    <e-column [width]=85></e-column>\n                    <e-column [width]=85></e-column>\n                    <e-column [width]=80></e-column>\n                    <e-column [width]=90></e-column>\n                </e-columns>\n            </e-sheet>\n        </e-sheets>\n    </ejs-spreadsheet>\n</div>\n"
    }
  ]
}