Skip to main content

RichEditScroll.setByDocumentPosition(position) Method

Scrolls the document to the specified position

Declaration

setByDocumentPosition(
    position: number,
    subDocumentId?: number,
    pageIndex?: number
): void

Parameters

Name Type Description
position number

The position in a document model.

subDocumentId number

An identifier of a sub-document.

pageIndex number

The page index.

Remarks

The setByDocumentPosition method searches the specified sub-document (subDocumentId) on the specified page (pageIndex). If the document is found, the method scrolls the document until the specified position (position) is displayed on the screen.

If the specified position is more than the length of the sub-document, the last sub-document position is displayed.

The pageIndex parameter is not in effect if the subDocumentId parameter species the main sub-document.

The subDocumentId and pageIndex parameters’ default value is equal to 0.

<dx:ASPxRichEdit ID="DemoRichEdit" runat="server" ClientInstanceName="richEdit" />
//scroll to a header on the third page
richEdit.scroll.setByDocumentPosition(0,1,2);
//scroll to the last position in the main sub-document
richEdit.scroll.setByDocumentPosition(richEdit.document.mainSubDocument.length,richEdit.document.mainSubDocument.id,0);
See Also