ASPxClientSidePreviewModel.GetCurrentPageIndex() Method

Returns the current page's zero-based index.

Namespace: DevExpress.XtraReports.Web.Scripts

Assembly: DevExpress.XtraReports.v18.2.Web.Scripts.dll


public int GetCurrentPageIndex()
Public Function GetCurrentPageIndex As Integer


Type Description

A zero-based integer value that specifies the index of a current page.

The code snippet below demonstrates how to use the ASPxClientReportDesigner.PreviewDocumentReady event to navigate through pages of a ready document. To obtain the current page number and navigate to the next page, use the GetCurrentPageIndex and ASPxClientSidePreviewModel.GoToPage methods.

<script type="text/javascript" id="script">
    function previewDocumentReady(s, e) {
        var previewModel = s.GetPreviewModel();
        var goToNextPage = function () {
            var pageIndex = previewModel.GetCurrentPageIndex();
            if (e.PageCount <= pageIndex)
            previewModel.GoToPage(pageIndex + 1);
            setTimeout(function () { goToNextPage(); }, 3000);

<dx:ASPxReportDesigner ID="ASPxReportDesigner1" runat="server">      
    <ClientSideEvents PreviewDocumentReady="previewDocumentReady"/>  
See Also