Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Create(string) Constructor

Creates a new instance of a spreadsheet protection provider.

#Declaration

Delphi
constructor Create(const APassword: string); overload;

#Parameters

Name Type
APassword string

#Remarks

Call this constructor to create an instance of the standard or strong spreadsheet protection provider, initializing the Password property with the value passed as the APassword parameter.

To enforce the spreadsheet document structure or worksheet password protection, assign the newly created protection provider to the OptionsProtection.ProtectionInfo property provided by the Spreadsheet/Report Designer control or a Table View worksheet, respectively:

var
  AProtectionInfo: IdxSpreadSheetProtectionInfo;
//...
  AProtectionInfo := TdxSpreadSheetStandardProtectionInfo.Create('Password');  // Create a standard protection provider with the required password
  dxSpreadSheet1.OptionsProtection.ProtectionInfo := AProtectionInfo;
  dxSpreadSheet1.OptionsProtection.&Protected := True;  // Enable the document structure's protection

For more information, refer to the Spreadsheet Document Structure Protection and Worksheet Protection sections of the Password Protection topics.

See Also