Can we make cell read-only conditionally? #103
Answered
by
anmcgrath
sankarkumar23
asked this question in
Q&A
-
Can we make a cell read-only conditionally? |
Beta Was this translation helpful? Give feedback.
Answered by
anmcgrath
Oct 20, 2024
Replies: 2 comments 1 reply
-
Hey @sankarkumar23 not 100% sure what you mean by conditionally? You should be able to do something like this:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I'll have a look at why my suggestion didn't work, but glad you found a solution. I saw your previous edit, if you want to conditionally limit the ability to edit cells you can do something like this: Sheet.Editor.BeforeCellEdit += (sender, args) =>
{
if (args.Cell.ValueType == CellValueType.Number)
{
if (args.Cell.GetValue<double>() > 0)
args.CancelEdit = true;
}
}; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sankarkumar23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'll have a look at why my suggestion didn't work, but glad you found a solution.
I saw your previous edit, if you want to conditionally limit the ability to edit cells you can do something like this: