{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-data-validation",
  "framework": "angular",
  "type": "registry:component",
  "component": "Spreadsheet",
  "variant": "data-validation",
  "dependencies": [
    "@syncfusion/ej2-angular-spreadsheet"
  ],
  "description": "Spreadsheet sample demonstrating data validation feature with gross pay calculation as an example.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "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": false,
    "platformIndex": "https://ai.syncfusion.com/angular/llms.txt",
    "skillPack": "syncfusion/angular-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/angular/spreadsheet-editor-data-validation.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-data-validation/spreadsheet-editor.component.html",
      "content": "<div class=\"control-section\">\n    <ejs-spreadsheet #spreadsheet (created)=\"created()\">\n        <e-sheets>\n            <e-sheet name=\"Gross Pay\">\n                <e-ranges>\n                    <e-range [dataSource]=\"grossPay\" startCell=\"A3\"></e-range>\n                </e-ranges>\n                <e-rows>\n                    <e-row>\n                        <e-cells>\n                            <e-cell value=\"Gross Pay Calculation\" [style]=\"{fontSize: '20pt', fontWeight: 'bold', textAlign: 'center', backgroundColor: '#B3FFB3', verticalAlign: 'middle'}\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                    <e-row index= \"13\">\n                        <e-cells>\n                            <e-cell index= \"7\" value=\"Total Gross\" [style]=\"{border: '1px solid #A6A6A6', textAlign: 'center', verticalAlign: 'middle', fontWeight: 'bold'}\"></e-cell>\n                            <e-cell index= \"8\" formula=\"=Sum(I4:I13)\" [format]=\"currencyFormat\" [style]=\"{border: '1px solid #A6A6A6', textAlign: 'center', verticalAlign: 'middle', fontWeight: 'bold'}\"></e-cell>\n                        </e-cells>\n                    </e-row>\n                </e-rows>\n                <e-columns>\n                    <e-column [width]=88></e-column>\n                    <e-column [width]=120></e-column>\n                    <e-column [width]=106></e-column>\n                    <e-column [width]=98></e-column>\n                    <e-column [width]=110></e-column>\n                    <e-column [width]=110></e-column>\n                    <e-column [width]=110></e-column>\n                    <e-column [width]=98></e-column>\n                    <e-column [width]=130></e-column>\n                </e-columns>\n            </e-sheet>\n        </e-sheets>\n    </ejs-spreadsheet>\n</div>"
    },
    {
      "target": "src/components/spreadsheet-editor-data-validation/spreadsheet-editor.component.ts",
      "content": "import { Component, ViewEncapsulation, ViewChild } from '@angular/core';\nimport { grossPay } from '../datasource/spreadsheet-editor-data';\nimport { SpreadsheetComponent, SpreadsheetModule } from '@syncfusion/ej2-angular-spreadsheet';\n/**\n * Data Validation Spreadsheet Component\n */\n@Component({\n    selector: 'control-content',\n    templateUrl: 'spreadsheet-editor.component.html',\n    encapsulation: ViewEncapsulation.None,\n    standalone: true,\n    imports: [SpreadsheetModule]\n})\n\nexport class DataValidationController {\n    @ViewChild('spreadsheet')\n    spreadsheetObj!: SpreadsheetComponent;\n    data: Object[] = grossPay();\n    currencyFormat: string = '$#,##0.00';\n    public grossPay: Object[] = grossPay();\n    created() {\n        this.spreadsheetObj.merge('A1:I2');\n        this.spreadsheetObj.setBorder({ border: '1px solid #A6A6A6' }, \"A1:I13\");\n        this.spreadsheetObj.cellFormat({ textAlign: 'center', verticalAlign: 'middle'}, 'A3:I13');\n        this.spreadsheetObj.cellFormat({ backgroundColor: '#B3FFB3', fontWeight : \"bold\"}, 'A3:I3');\n        this.spreadsheetObj.numberFormat('$#,##0.00', 'H4:I13');\n        this.spreadsheetObj.numberFormat('m/d/yyyy', 'C4:C13');\n        this.spreadsheetObj.wrap('H3:I3');\n        //Add Data validation to range.\n        this.spreadsheetObj.addDataValidation({ type: 'WholeNumber', operator: 'LessThan', value1: '9', ignoreBlank: false }, 'G4:G13');\n        this.spreadsheetObj.addDataValidation({ type: 'TextLength', operator: 'GreaterThan', value1: '3', ignoreBlank: false }, 'B4:B13');\n        this.spreadsheetObj.addDataValidation({ type: 'Time', operator: 'GreaterThan', value1: '8:00:00 AM', ignoreBlank: false  }, 'E4:E13');\n        this.spreadsheetObj.addDataValidation({ type: 'Time', operator: 'LessThan', value1: '6:00:00 PM', ignoreBlank: false  }, 'F4:F13');\n        this.spreadsheetObj.addDataValidation({ type: 'List', value1: 'Mon, Tue, Wed, Thu, Fri', ignoreBlank: false  }, 'D4:D13');\n        this.spreadsheetObj.addDataValidation({ type: 'WholeNumber', operator: 'LessThan', value1: '=H5', ignoreBlank: false }, 'I4:I13');\n        //Highlight Invalid Data.\n        this.spreadsheetObj.addInvalidHighlight('G4:G13');\n        this.spreadsheetObj.addInvalidHighlight('I4:I13');\n    }\n}"
    }
  ]
}