Skip to main content
Box

DocumentLayout.GetElement(DocumentPosition, LayoutType) Method

Gets the layout element of the specified type which relates to the specified position in the document model.

Namespace: DevExpress.XtraRichEdit.API.Layout

Assembly: DevExpress.RichEdit.v24.1.Core.dll

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

public RangedLayoutElement GetElement(
    DocumentPosition position,
    LayoutType type
)

Parameters

Name Type Description
position DocumentPosition

A DocumentPosition object that specifies the position in the document model.

type LayoutType

A LayoutType enumeration that specifies the type of the requested layout element.

Returns

Type Description
RangedLayoutElement

A RangedLayoutElement class descendant if the specified layout type can be related to a document position; otherwise, an exception is thrown.

Remarks

Important

If the specified layout type cannot be related to a document position (e.g. LayoutType.BookmarkStartBox, LayoutType.BookmarkEndBox), an exception is thrown.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GetElement(DocumentPosition, LayoutType) 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.

See Also