TCustomRichView.Document

<< Click to display table of contents >>

TCustomRichView.Document

Allows linking this TRichView component to a database field (Delphi XE2+)

property Document: TRVDocumentProperty;

(introduced in v21)

LiveBindings

You can use LiveBindings to link this property to a dataset field of TBlobField type.

This is an alternative way of using TRichView components to view and edit database fields, which works both in VCL and FireMonkey frameworks. Another ways is using TDBRichView and TDBRichViewEdit components (available in VCL and LCL frameworks).

This property contains sub-properties controlling this linking.

Important note: in order to link Document to TBlobField, DBRV unit (or fmxDBRV unit for FireMonkey) must be included in the project (add it in "uses").

Copying a document

Another use of this property is copying a document between TRichView controls.

The code

RichView1.Document := RichView2.Document;

copies a document from RichView2 to RichView1.

Internally, this assignment is implemented as copying via a temporary memory stream (in RVF format). After copying, the destination TRichView control is formatted (unless it is TRVReportHelper's RichView).

 

See also events:

OnNewDocument

OnLoadDocument

OnLoadCustomFormat

See also events of TRichViewEdit:

OnSaveCustomFormat