Back to Devexpress

DocumentLayout.BeginUpdateDocument(RangedLayoutElement) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-documentlayout-dot-beginupdatedocument-x28-devexpress-dot-xtrarichedit-dot-api-dot-layout-dot-rangedlayoutelement-x29.md

latest3.9 KB
Original Source

DocumentLayout.BeginUpdateDocument(RangedLayoutElement) Method

Starts modifying the document obtained via a layout element.

Namespace : DevExpress.XtraRichEdit.API.Layout

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
public SubDocument BeginUpdateDocument(
    RangedLayoutElement element
)
vb
Public Function BeginUpdateDocument(
    element As RangedLayoutElement
) As SubDocument

Parameters

NameTypeDescription
elementRangedLayoutElement

A RangedLayoutElement object that is the layout element which has a related DocumentRange.

|

Returns

TypeDescription
SubDocument

A SubDocument instance allowing you to safely modify the document.

|

Remarks

Use the DocumentLayout.BeginUpdateDocument - DocumentLayout.EndUpdateDocumentpair to modify the document obtained via a layout element implementing the RangedLayoutElement interface. In that case, it is very important to distinguish different parts of the document, such as header, footer and body. The BeginUpdateDocument method implements this requirement.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BeginUpdateDocument(RangedLayoutElement) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-layout-api-practical-usage/CS/WindowsFormsApplication1/DocumentLayoutHelper/TextBoxLayoutHelper.cs#L54

csharp
SubDocument doc = currentLayout.BeginUpdateDocument(currentTextBox);
string plainTextContent = doc.GetText(doc.Range);

winforms-richedit-layout-api-practical-usage/VB/WindowsFormsApplication1/DocumentLayoutHelper/TextBoxLayoutHelper.vb#L59

vb
Dim doc As SubDocument = currentLayout.BeginUpdateDocument(currentTextBox)
Dim plainTextContent As String = doc.GetText(doc.Range)

See Also

DocumentLayout Class

DocumentLayout Members

DevExpress.XtraRichEdit.API.Layout Namespace