Back to Devexpress

DocumentFormat Enum

blazor-devexpress-dot-blazor-dot-richedit-54d56618.md

latest1.8 KB
Original Source

DocumentFormat Enum

Lists file document formats.

Namespace : DevExpress.Blazor.RichEdit

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public enum DocumentFormat

Members

NameDescription
OpenXml

Office Open XML format (DOCX).

| | Rtf |

Rich text format.

| | PlainText |

Plain text format.

| | Html |

HTML format.

|

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.

razor
<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 canceled. */
        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

DevExpress.Blazor.RichEdit Namespace