Loads the content of the specified file into the XRRichText control.
The LoadFile method supports the following file extensions: .htm, .html, .rtf, .txt and .docx.
The loaded file's content replaces the XRRichText control's entire contents.
This method treats the specified file's content to be stored in the Rich Text Format and loads this content to the XRRichText as true RTF. If you want to load the file content as plain text, you need to call the overloaded LoadFile method with the XRRichTextStreamType.PlainText parameter.
The following example demonstrates how to create an XRRichText object in code and load its content from a file.
using DevExpress.XtraReports.UI; // ... // Create an XRRichText object. XRRichText xrRichText1 = new XRRichText(); // Set its height to be calculated automatically, // and make its borders visible. xrRichText1.CanGrow = true; xrRichText1.CanShrink = true; xrRichText1.Borders = DevExpress.XtraPrinting.BorderSide.All; // Load the control content from a file. xrRichText1.LoadFile("input.rtf");