The event handler receives an argument of type System.EventArgs containing data related to this event.
The DocumentLoaded event fires after the LoadDocument or DevExpress.XtraRichEdit.API.Native.Document.LoadDocument method call.
The event is also raised when the following properties change their values:
The DocumentLoaded fires when the Document Model is built and the loaded document is valid. Handle the DevExpress.XtraRichEdit.API.Layout.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:
C# |
richEditControl.LoadDocument("FirstLook.docx");
richEditControl.DocumentLoaded += RichEditControl_DocumentLoaded;
private void RichEditControl_DocumentLoaded(object sender, EventArgs e)
{
RichEditControl control = sender as RichEditControl;
if (control.Document.Fields.Count != 0)
{
control.Document.Fields.Update();
}
}
|
VB |
richEditControl.LoadDocument("FirstLook.docx")
AddHandler richEditControl.DocumentLoaded, AddressOf RichEditControl_DocumentLoaded
private void RichEditControl_DocumentLoaded(Object sender, EventArgs e)
Dim control As RichEditControl = TryCast(sender, RichEditControl)
If control.Document.Fields.Count <> 0 Then
control.Document.Fields.Update()
End If
|