Replies: 4 comments 4 replies
-
Yes you are correct, this is a bug. Seems like you can also paste into it. |
Beta Was this translation helpful? Give feedback.
-
I use the following and it works for me. The idea is to cancel the edit mode and it will prevent the user from editing the cells. You can use more logic by viewing the post: https://github.com/anmcgrath/BlazorDatasheet/discussions/103#discussion-7222702 razor page razor.cs page
|
Beta Was this translation helpful? Give feedback.
-
Actually it won't work when the user just selected the cell (the cell hasn't yet changed to edit mode) and press 'Delete' key. |
Beta Was this translation helpful? Give feedback.
-
Hi all, thanks for the input. See PR #180 which should fix this issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I set the cell with CellFormat.IsReadOnly to true. This works properly and prevents the user to modify the content in the cell. Unfortunately it cannot prevent the user from delete the content in that cell with 'Delete' key.
I saw this code in Datasheet.razor.cs file. It seems this key cannot detect IsReadOnly in CellFormat. Do I understand correctly?
ShortcutManager.Register(["Delete", "Backspace"], KeyboardModifiers.Any, _ => _sheet.Commands.ExecuteCommand(new ClearCellsCommand(_sheet.Selection.Regions)), _ => _sheet.Selection.Regions.Any() && !_sheet.Editor.IsEditing);
Beta Was this translation helpful? Give feedback.
All reactions