# spreadsheet-editor-cell-template

> Spreadsheet editor with cell template feature using interview registration form scenario with input components.

**Framework:** react  **Component:** SpreadsheetEditor  **Variant:** cell-template

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/react/ts/spreadsheet-editor-cell-template.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-react-spreadsheet @syncfusion/ej2-react-inputs @syncfusion/ej2-react-buttons @syncfusion/ej2-react-dropdowns
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/spreadsheet-editor-cell-template/SpreadSheetEditor.tsx

```tsx
import React from 'react';
import { SpreadsheetComponent, SheetsDirective, SheetDirective, ColumnsDirective, type CellStyleModel, RowsDirective, RowDirective, CellsDirective, RangesDirective, RangeDirective, CellDirective, ColumnDirective, type ScrollSettingsModel } from '@syncfusion/ej2-react-spreadsheet';
import { TextBoxComponent } from '@syncfusion/ej2-react-inputs';
import { RadioButtonComponent, ButtonComponent } from '@syncfusion/ej2-react-buttons';
import { DropDownListComponent, MultiSelectComponent } from '@syncfusion/ej2-react-dropdowns';
import type { SelectionSettingsModel } from '@syncfusion/ej2-spreadsheet';
import '../spreadsheet-editor.css';

/**
 * CellTemplate sample
 */

function CellTemplate(): React.ReactElement {
    let spreadsheet: SpreadsheetComponent;
    const scrollSettings: ScrollSettingsModel = { isFinite: true };
    const selectionSettings: SelectionSettingsModel = { mode: 'None' };
    const boldCenter: CellStyleModel = {
        fontWeight: 'bold', textAlign: 'center', fontSize: '12pt', verticalAlign: 'middle',
        textDecoration: 'underline'
    };

    function nameTextbox(): React.ReactElement {
        return (
            <TextBoxComponent placeholder="Name"></TextBoxComponent>
        );
    }

    function dobTextbox(): React.ReactElement {
        return (
            <TextBoxComponent placeholder="DOB"></TextBoxComponent>
        );
    }

    function genderRadioButton(): React.ReactElement {
        return (
            <div style={{ paddingLeft: '2px' }}>
                <RadioButtonComponent name="gender" value="male" label="Male"></RadioButtonComponent>
                <RadioButtonComponent name="gender" value="female" label="Female"></RadioButtonComponent>
            </div>
        );
    }

    function dropDownList(): React.ReactElement {
        let experience: string[] = ['0 - 1 year', '1 - 3 years', '3 - 5 years', '5 - 10 years'];
        return (
            <DropDownListComponent placeholder="Experience" dataSource={experience}></DropDownListComponent>
        );
    }

    function multiSelect(): React.ReactElement {
        let languages: string[] = ['JAVA', 'C#', 'SQL'];
        return (
            <MultiSelectComponent placeholder="Areas of Interest" showClearButton={false} dataSource={languages}></MultiSelectComponent>
        );
    }

    function mobileNoTextbox(): React.ReactElement {
        return (
            <TextBoxComponent placeholder="Mobile Number"></TextBoxComponent>
        );
    }

    function emailTextbox(): React.ReactElement {
        return (
            <TextBoxComponent placeholder="Email"></TextBoxComponent>
        );
    }

    function textArea(): React.ReactElement {
        return (
            <TextBoxComponent placeholder="Address" multiline={true}></TextBoxComponent>
        );
    }

    function button(): React.ReactElement {
        return (
            <ButtonComponent content="Add" style={{ float: "right" }} cssClass="e-flat"></ButtonComponent>
        );
    }

    function onCreated(): void {
        spreadsheet.cellFormat({ fontWeight: 'bold' }, 'B2:B9');
        // Merges B1 and C1 cells
        spreadsheet.merge('B1:C1');
    }

    return (
        <div className='control-pane'>
            <div className='control-section spreadsheet-control'>
                <SpreadsheetComponent showRibbon={false} enableContextMenu={false} allowPrint={false} showFormulaBar={false} cssClass={'e-custom-spreadsheet'} allowOpen={false} allowSave={false}
                    ref={(ssObj: SpreadsheetComponent | null) => { if (ssObj) spreadsheet = ssObj }} created={onCreated} name={'Candidates List'}
                    scrollSettings={scrollSettings} allowEditing={false} selectionSettings={selectionSettings}>
                    <SheetsDirective>
                        <SheetDirective name='Registration Form' rowCount={40} colCount={30} showGridLines={false}>
                            <RowsDirective>
                                <RowDirective height={55}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Interview Registration Form' style={boldCenter}></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={45}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Name'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={45}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Date of Birth:'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={45}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Gender:'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={45}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Year of Experience:'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={45}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Areas of Interest:'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={45}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Mobile Number:'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={45}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Email:'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                                <RowDirective height={82}>
                                    <CellsDirective>
                                        <CellDirective index={1} value='Address:'></CellDirective>
                                    </CellsDirective>
                                </RowDirective>
                            </RowsDirective>
                            <ColumnsDirective>
                                <ColumnDirective index={1} width={190}></ColumnDirective>
                                <ColumnDirective width={350}></ColumnDirective>
                            </ColumnsDirective>
                            <RangesDirective>
                                <RangeDirective template={nameTextbox} address='C2'></RangeDirective>
                                <RangeDirective template={dobTextbox} address='C3'></RangeDirective>
                                <RangeDirective template={genderRadioButton} address='C4'></RangeDirective>
                                <RangeDirective template={dropDownList} address='C5'></RangeDirective>
                                <RangeDirective template={multiSelect} address='C6'></RangeDirective>
                                <RangeDirective template={mobileNoTextbox} address='C7'></RangeDirective>
                                <RangeDirective template={emailTextbox} address='C8'></RangeDirective>
                                <RangeDirective template={textArea} address='C9'></RangeDirective>
                                <RangeDirective template={button} address='C11'></RangeDirective>
                            </RangesDirective>
                        </SheetDirective>
                    </SheetsDirective>
                </SpreadsheetComponent>
            </div>
        </div>
    )
}
export default CellTemplate;
```
