blazor-devexpress-dot-blazor-dot-richedit-54d56618.md
Lists file document formats.
Namespace : DevExpress.Blazor.RichEdit
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
public enum DocumentFormat
| Name | Description |
|---|---|
OpenXml |
Office Open XML format (DOCX).
|
| Rtf |
Rich text format.
|
| PlainText |
Plain text format.
|
| Html |
HTML format.
|
The following properties accept/return DocumentFormat values:
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 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