See the T545652 ticket.
Implement the dedicated exception class for content modification errors occurring in a protected worksheet
Answers approved by DevExpress Support
We have implemented the functionality described in this ticket. It will be included in our next update(s).
Please check back and leave a comment to this response to let us know whether or not this solution addresses your concerns.
With v17.2.4, a restricted action performed in a protected worksheet raises an ExpressSpreadSheetProtectionError exception, allowing you to handle it separately from all other error types that occur in ExpressSpreadSheet controls.
Are you going to implement it in 17.1.n chain or shall I move to 17.2 to get this functionality?
Hello Michal,
This functionality is implemented only in v17.2. If you need to have a special "protection" exception type in v17.1, you can manually implement it in the dxSpreadSheetCore.pas unit in the following manner (EdxSpreadSheetProtectionError is a new type):
Delphiprocedure TdxSpreadSheetTableView.CheckProtection(AMode: TdxSpreadSheetCellsModificationMode; const AArea: TRect);
begin
if not SpreadSheet.OptionsBehavior.Editing or Options.&Protected and (GetLockedStateOfCellsInArea(AArea) <> cbUnchecked) then
raise EdxSpreadSheetProtectionError.Create(cxGetResourceString(@sdxErrorCellProtected));
if not CanModifyDataInArrayFormulaArea(AArea, AMode) then
raise EdxSpreadSheetCannotChangePartOfArrayError.Create(sdxErrorCannotChangePartOfArray);
end;