Disable add/remove rows/columns/sheet in Spreadsheet

1 Answer 716 Views
Spreadsheet
Ryabinin
Top achievements
Rank 1
Ryabinin asked on 22 Feb 2022, 09:22 AM

Hi!

What is the best way to disable add/remove rows/columns/sheet in Spreadsheet for some user groups?

I know, that I can hide/disable controls for adding/deleting/renaming sheet. Is there more elegant solution?

Also I know, that I can disable individual cells (that prvents remove whole row/column end for last row/column aslo prevent adding another row/column) - so I can disable whole last row and last column (so I need at least one extra empty row). Is there more elegant solution?

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 25 Feb 2022, 09:01 AM

Hello, Ryabinin,

You can use the Sheet methods to add/remove rows. To insert/delete/rename a sheet, you can use the Spreadsheet methods. Currently there is no built-in method to disable a row/column, but you can add custom logic to use the Range enable method.

Let me know if you have any further questions.

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Ryabinin
Top achievements
Rank 1
commented on 02 Mar 2022, 04:29 AM

Hello, Martin,

Thank you. I am found insertColumn/insertRow/deleteColumn/deleteRow events - I can use prefentDefault to disable action.

My next question: how to customize context menu (remove: delete entry) on rows and columns?

Martin
Telerik team
commented on 04 Mar 2022, 02:10 PM

You can set a custom class for the item with the code below and then use CSS to hide it:

 $("[data-action='delete-column']").addClass("hidden")

.hidden{
display:none;
}

Tags
Spreadsheet
Asked by
Ryabinin
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or