Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxRichEdit.DocumentName Property

Specifies the name of the downloaded file.

Namespace: DevExpress.Blazor.RichEdit

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

NuGet Package: DevExpress.Blazor.RichEdit

#Declaration

C#
[Parameter]
public string DocumentName { get; set; }

#Property Value

Type Description
String

The name of the downloaded file.

#Remarks

When a user clicks a command in the Rich Text Editor’s Download Menu, the component downloads the document in the corresponding file format. Use the DocumentName property to specify the name of the downloaded document.

Razor
<DxRichEdit DocumentFormat="DocumentFormat.Rtf"
            @bind-DocumentContent="@documentContent"
            DocumentName="Custom name" />

@code {
    byte[] documentContent;
    string filePath = "C:\\Users\\Public\\annual-report.rtf";

    protected override async Task OnInitializedAsync() {
    /* 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 {
            documentContent = await File.ReadAllBytesAsync(filePath);
            await base.OnInitializedAsync();
        }
        catch (OperationCanceledException e) {
            Console.WriteLine($"{nameof(OperationCanceledException)} thrown with message: {e.Message}");
        }
    }
}
See Also