- Home
- Forum
- Angular - EJ 2
- Row/Column protection
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!
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
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.
Thank you Janakiraman. Your example satisfy my requirement.
- 3 Replies
- 2 Participants
-
RE Rahal Ekanayaka
- Oct 6, 2021 03:00 PM UTC
- Oct 11, 2021 06:32 AM UTC