Row/Column protection

Is it possible to dig down protection to row/column level? My requirement is I need to lock everything in red coloured cells and green coloured cells should be able to edit

 Appreciate if I can have sample

Thank you!


3 Replies

JS Janakiraman Sakthivel Syncfusion Team October 8, 2021 02:33 AM UTC

Hi Rahal Ekanayaka,


Thank you for contacting Syncfusion support.


We have checked your reported requirement and it can be achievable in our spreadsheet by using the lockCells method as like as below.


  

    <button id="button1" (click)="setProtection()">set protection</button>

    <ejs-spreadsheet #default [openUrl]="openUrl" [saveUrl]="saveUrl">

    </ejs-spreadsheet>

 

   setProtection() {

        this.spreadsheetObj.protectSheet(0, { selectCells: true});

        this.spreadsheetObj.lockCells('A3:C14', false);

    }

 


For your convenience, we have prepared the sample based on our requirement. Please find the link below.


Sample Link: https://stackblitz.com/edit/angular-c62pgw-owbtlr?file=app.component.ts


For more details regarding the spreadsheet protection, please find the links below.


Documentation Link:

https://ej2.syncfusion.com/angular/documentation/spreadsheet/protect-sheet/#protect-sheet


https://ej2.syncfusion.com/angular/documentation/spreadsheet/protect-sheet/#unlock-the-particular-cells-in-the-protected-sheet


API Link :

https://ej2.syncfusion.com/angular/documentation/api/spreadsheet/#protectsheet

https://ej2.syncfusion.com/angular/documentation/api/spreadsheet/#lockcells


Demo Link: https://ej2.syncfusion.com/angular/demos/#/bootstrap5/spreadsheet/protect-sheet


Could you please check the above details and get back to us, if you need any further assistance on this.


Regards, 

Janakiraman S.



RE Rahal Ekanayaka October 9, 2021 04:58 PM UTC

Thank you Janakiraman. Your example satisfy my requirement.



JS Janakiraman Sakthivel Syncfusion Team October 11, 2021 06:32 AM UTC

Hi Rahal Ekanayaka, 
 
Thank you for your update. 
 
We are happy to hear that your requirement has been achieved. Kindly get back to us if you need any further assistance. 
 
Regards, 
Janakiraman S. 


Loader.
Up arrow icon