{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "spreadsheet-editor-data-validation",
  "framework": "react",
  "type": "registry:component",
  "component": "SpreadsheetEditor",
  "variant": "data-validation",
  "dependencies": [
    "@syncfusion/ej2-react-spreadsheet"
  ],
  "description": "Spreadsheet editor with data validation feature using 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/react/llms.txt",
    "skillPack": "syncfusion/react-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/react/ts/spreadsheet-editor-data-validation.md"
  },
  "files": [
    {
      "target": "src/components/spreadsheet-editor-data-validation/SpreadSheetEditor.tsx",
      "content": "import React from 'react';\nimport { SpreadsheetComponent, SheetDirective, RowsDirective, CellsDirective, CellDirective, RowDirective, SheetsDirective, ColumnsDirective, ColumnDirective, RangesDirective, RangeDirective } from '@syncfusion/ej2-react-spreadsheet';\nimport { grossPay } from '../datasource/spreadsheet-editor.data';\nimport '../spreadsheet-editor.css';\n\n/**\n * Data Validation sample\n */\n\nfunction DataValidation(): React.ReactElement {\n    let spreadsheet: SpreadsheetComponent;\n    const currencyFormat: string = '$#,##0.00';\n    function onCreated(): void {\n        spreadsheet.merge('A1:I2');\n        spreadsheet.setBorder({ border: '1px solid #A6A6A6' }, 'A1:I13');\n        spreadsheet.cellFormat({ textAlign: 'center', verticalAlign: 'middle' }, 'A3:I13');\n        spreadsheet.cellFormat({ backgroundColor: '#B3FFB3', fontWeight: 'bold' }, 'A3:I3');\n        spreadsheet.numberFormat(currencyFormat, 'H4:I13');\n        spreadsheet.numberFormat('m/d/yyyy', 'C4:C13');\n        spreadsheet.wrap('H3:I3');\n        //Add Data validation to range.\n        spreadsheet.addDataValidation({ type: 'WholeNumber', operator: 'LessThan', value1: '9', ignoreBlank: false }, 'G4:G13');\n        spreadsheet.addDataValidation({ type: 'TextLength', operator: 'GreaterThan', value1: '3', ignoreBlank: false }, 'B4:B13');\n        spreadsheet.addDataValidation({ type: 'Time', operator: 'GreaterThan', value1: '8:00:00 AM', ignoreBlank: false }, 'E4:E13');\n        spreadsheet.addDataValidation({ type: 'Time', operator: 'LessThan', value1: '6:00:00 PM', ignoreBlank: false }, 'F4:F13');\n        spreadsheet.addDataValidation({ type: 'List', value1: 'Mon, Tue, Wed, Thu, Fri', ignoreBlank: false }, 'D4:D13');\n        spreadsheet.addDataValidation({ type: 'WholeNumber', operator: 'LessThan', value1: '=H5', ignoreBlank: false }, 'I4:I13');\n        //Highlight Invalid Data.\n        spreadsheet.addInvalidHighlight('G4:G13');\n        spreadsheet.addInvalidHighlight('I4:I13');\n    }\n    return (\n        <div className='control-pane'>\n            <div className='control-section spreadsheet-control'>\n                <SpreadsheetComponent ref={(ssObj: SpreadsheetComponent | null) => { if (ssObj) spreadsheet = ssObj }} created={onCreated}>\n                    <SheetsDirective>\n                        <SheetDirective name='Gross Pay' selectedRange='D13'>\n                            <RangesDirective>\n                                <RangeDirective dataSource={grossPay} startCell='A3' ></RangeDirective>\n                            </RangesDirective>\n                            <RowsDirective>\n                                <RowDirective>\n                                    <CellsDirective>\n                                        <CellDirective value='TimeSheet Calculation' style={{ fontSize: '20pt', fontWeight: 'bold', textAlign: 'center', backgroundColor: '#B3FFB3', verticalAlign: 'middle' }} ></CellDirective>\n                                    </CellsDirective>\n                                </RowDirective>\n                                <RowDirective index={13}>\n                                    <CellsDirective>\n                                        <CellDirective index={7} value='Total Gross' style={{ border: '1px solid #A6A6A6', textAlign: 'center', verticalAlign: 'middle', fontWeight: 'bold' }}></CellDirective>\n                                        <CellDirective index={8} formula='=Sum(I4:I13)' format={currencyFormat} style={{ border: '1px solid #A6A6A6', textAlign: 'center', verticalAlign: 'middle', fontWeight: 'bold' }}></CellDirective>\n                                    </CellsDirective>\n                                </RowDirective>\n                            </RowsDirective>\n                            <ColumnsDirective>\n                                <ColumnDirective width={88}></ColumnDirective>\n                                <ColumnDirective width={120}></ColumnDirective>\n                                <ColumnDirective width={106}></ColumnDirective>\n                                <ColumnDirective width={98}></ColumnDirective>\n                                <ColumnDirective width={110}></ColumnDirective>\n                                <ColumnDirective width={110}></ColumnDirective>\n                                <ColumnDirective width={110}></ColumnDirective>\n                                <ColumnDirective width={98}></ColumnDirective>\n                                <ColumnDirective width={130}></ColumnDirective>\n                            </ColumnsDirective>\n                        </SheetDirective>\n                    </SheetsDirective>\n                </SpreadsheetComponent>\n            </div>\n        </div>\n    )\n}\nexport default DataValidation;"
    }
  ]
}