Back to Devexpress

DxRichEdit.DocumentContentChanging Event

blazor-devexpress-dot-blazor-dot-richedit-dot-dxrichedit-cde0f9e2.md

latest2.3 KB
Original Source

DxRichEdit.DocumentContentChanging Event

Allows you to notify users that the Rich Text Editor starts saving.

Namespace : DevExpress.Blazor.RichEdit

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

NuGet Package : DevExpress.Blazor.RichEdit

Declaration

csharp
[Parameter]
public EventCallback DocumentContentChanging { get; set; }

Remarks

The Rich Text Editor updates the DocumentContent property value and raises the DocumentContentChanging and DocumentContentChanged events in the following cases:

The DocumentContentChanging event occurs before the DocumentContentChanged event. Handle the DocumentContentChanged event to save the document.

The following code example displays the DxPopup when the DocumentContentChanging event occurs:

razor
<DxPopup @bind-Visible="@PopupVisible" HeaderText="Info" BodyText="The Rich Edit starts saving."/>

<DxRichEdit DocumentContentChanging="OnDocumentContentChanging" 
            DocumentFormat="DocumentFormat.OpenXml" 
            @bind-DocumentContent="@documentContent" />

@code {
    byte[] documentContent;
    bool PopupVisible { get; set; } = false;

    async Task OnDocumentContentChanging() {
        PopupVisible = true;        
    }    
}

See Also

Document Management in Blazor Rich Text Editor

DxRichEdit Class

DxRichEdit Members

DevExpress.Blazor.RichEdit Namespace