DocumentFormat Enum

Lists file document formats.

Namespace: DevExpress.Blazor.RichEdit

Assembly: DevExpress.Blazor.RichEdit.v21.2.dll

Declaration

public enum DocumentFormat

Members

Name Description
OpenXml

Office Open XML format (DOCX).

Rtf

Rich text format.

PlainText

Plain text format.

Related API Members

The following properties accept/return DocumentFormat values:

Remarks

Use the DocumentFormat enumeration values to specify a file document format when you load or export a document.

<DxRichEdit @ref="richEdit1" />
<DxRichEdit @ref="richEdit2" />
@code {
    DxRichEdit richEdit1 { get; set; }
    DxRichEdit richEdit2 { get; set; }
    @* ... *@
    /* Surround the code that contains an asynchronous operation with a try-catch block to handle
    the OperationCanceledException. This exception is thrown when an asynchronous operation is cancelled. */
        try {
            byte[] fileContent = await richEdit1.ExportDocumentAsync(DocumentFormat.Rtf);
            await richEdit2.LoadDocumentAsync(fileContent, DocumentFormat.Rtf);
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
}
See Also