DocumentSettings.Encryption Property
Provides access to the document encryption options used to save a password encrypted document.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v19.1.Core.dll
Declaration
Property Value
Type | Description |
---|---|
EncryptionOptions | A EncryptionOptions object that represents the document encryption settings. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to Encryption |
---|---|
IWorkbook |
|
Workbook |
|
Example
This code snippet obtains the DocumentSettings.Encryption
settings selected in the editors and prompts for saving a password encrypted file.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-load-and-save-a-password-encrypted-file-t464814
IWorkbook workbook = spreadsheetControl1.Document;
workbook.DocumentSettings.Encryption.Type = (EncryptionType)Enum.Parse(typeof(EncryptionType), barEncryptionTypeComboBox.EditValue.ToString());
workbook.DocumentSettings.Encryption.Password = barPasswordEdit.EditValue.ToString();
spreadsheetControl1.SaveDocumentAs();
See Also