A newer version of this page is available. Switch to the current version.

RichEditControl.DocumentLoaded Event

Occurs after the document is fully loaded.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v19.1.dll

Declaration

public event EventHandler DocumentLoaded

Event Data

The DocumentLoaded event's data class is EventArgs.

Remarks

The DocumentLoaded event occurs when the document model is built and the loaded document is valid.

Call the RichEditControl.LoadDocument or Document.LoadDocument method to load a document.

You can specify the following properties to load content in the specific format:

Handle the DocumentLayout.DocumentFormatted event to check the loaded document’s layout.

NOTE

The RichEditControl does not provide a technique to determine the moment when all images with external references are downloaded and inserted in an HTML document.

The code sample below shows how to update fields in the main body of a loaded document:

richEditControl.DocumentLoaded += RichEditControl_DocumentLoaded;
richEditControl.LoadDocument("FirstLook.docx");


private void RichEditControl_DocumentLoaded(object sender, EventArgs e)
{
    RichEditControl control = sender as RichEditControl;
    if (control.Document.Fields.Count != 0)
    {
        control.Document.Fields.Update();
    }
}
See Also