# spreadsheet-editor-protection

> Spreadsheet editor with protected sheets and locked cell editing to safeguard worksheet data.

**Framework:** blazor  **Component:** Spreadsheet  **Variant:** protection

## 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/blazor/spreadsheet-editor-protection.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.Blazor.Spreadsheet
```

**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-protection/SpreadSheetEditor.razor

```razor
@page "/spreadsheet/protection"
@namespace blazor.Components.Pages.Protection.Protection
@using Syncfusion.Blazor.Spreadsheet
@using System.IO

<div class="col-lg-12 control-section">
    <div class="content-wrapper">
        <div class="row">
            <div>
                <SfSpreadsheet DataSource="@DataSourceBytes">
                </SfSpreadsheet>
            </div>
        </div>
    </div>
</div>

@code {
    // The workbook contains a repayment schedule. Sheet protection is
    // enabled in the xlsx file itself (each sheet is marked protected),
    // so users need to unprotect through the Review ribbon to edit.
    public byte[] DataSourceBytes { get; set; } = Array.Empty<byte>();

    protected override void OnInitialized()
    {
        string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "src", "blazor", "spreadsheet-editor", "protection", "repayment.xlsx");
        DataSourceBytes = File.ReadAllBytes(filePath);
    }
}
```

### src/components/spreadsheet-editor-protection/repayment.xlsx

```xlsx
PK    phZ]�]U��   3     [Content_Types].xml�Q�N�0�y
�k;e@5�P`�� �}I��O>��o��BT������ڌβ&2�7|)j�Ы�����{�n9�^�~D���jw�H��=5��9�II�G$BD_�6$����� �뺾�*��>Wy����[����r?5Ih���9�5b�FA.�<x�-���E9s�7�����	�9�K�\'��R~Whr��=��-�A��r�gh[�P�wE"(&M=bvV�S80~�3��<�����."�?_ PK    phZ]~o���   *     _rels/.rels��;�0��SD�iZ�PC�����}�I%�ۓ*F��?�e5͞��HV@����*jG��5��X�ҶR�E�N��ZƔ	��K��ݑ�42d�ЦNG�ȘJ�s'�${�<�s�i�
eu+��m�Y��S׍
Ϥm��c5�d�{�f�_�;є%x:��xzPK    phZ]�P���   *     xl/workbook.xml���n�0��<������(�Y� Y�� �E�B$R��y�2u�g"��}��v?)�/,�zج0H#�@�>�O/`�:�.2aW�������l�O��\kn��q��d�I��KrU�r��:/3bM�n���&B[a�4��<^R] ���^�4���i�%����]o�t���n��kk0����߀:��Xu��s�PK    phZ]�o<|�   )     xl/_rels/workbook.xml.rels���
�0�OQrw�<�Ⱥ]D�U��.�`[[�����x<��O~!y��'q'σ5�$AF�f0��k}�@pP�Q�5$a!�����T�;��EDK�CpGD�=͊��Ĥ�~V!��C���:�]���P�LQ5|�d ���?�m�A����L&�8��G�BD��(H���%K�
X���xPK    phZ]9m�^�  &     xl/worksheets/sheet1.xml}��n�0���),���_U�&R�]�R�{�Icld�d�O�&�(A�w��9�����ߦFНP��>�0Y�������^�u��-�����������G�0�> ��i�(��=4�#�i���7���i�j�۳��)�6\H\�������oJ}��Ͷ���l�tzika
�02��	;�u]�� #^q�g�����QM���-����2�����O��2�ꈴM���Ão'X�ZHx1�օu��䧆��V_��űt9���i�4�{t�V�63�O�1Z�J���1�\��4��33��˳�5���� �٘"s����jf�^������a�2����aN�Y]4/`�Oo�ՠ�qL��VZR�gqBR6�7����֞ct6�#c��E�҈$l�8h�"�/� Mm6��:��[v�jcb��E���qТ(#̟ R%!#a2a�W?q�PK    phZ]�]U��   3             �    [Content_Types].xmlPK    phZ]~o���   *             �/  _rels/.relsPK    phZ]�P���   *             �	  xl/workbook.xmlPK    phZ]�o<|�   )             ��  xl/_rels/workbook.xml.relsPK    phZ]9m�^�  &             ��  xl/worksheets/sheet1.xmlPK      E  �    
```
