.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
A newer version of this page is available. Switch to the current version.

RichEditDocumentServer.DecryptionFailed Event

Occurs if the RichEditDocumentServer failed to open an encrypted file.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v19.1.Core.dll


public event DecryptionFailedEventHandler DecryptionFailed

Event Data

The DecryptionFailed event's data class is DecryptionFailedEventArgs. The following properties provide information specific to this event:

Property Description
Exception Returns an exception that led to the event.


The DecryptionFailed event is raised when the RichEditDocumentServer cannot decrypt a loaded file. Check the Exception property to determine the exception that led to this event.

The event also occurs if the EncryptedFilePasswordCheckFailedEventArgs.TryAgain property is not specified or set to false.

If the event is not handled, the RichEditDocumentServer does not load an empty file.

The code sample below shows how to handle the DecryptionFailed event to show an exception message.


A complete code sample project is available at https://github.com/DevExpress-Examples/how-to-open-and-save-encrypted-files.

private static void Server_DecryptionFailed(object sender, DecryptionFailedEventArgs e)
    Console.WriteLine(e.Exception.Message.ToString()+" Press any key to close...");
See Also