ASPxClientWebDocumentViewer.CustomizeElements Event

Allows you to customize the Web Document Viewer's UI elements.

Namespace: DevExpress.XtraReports.Web.Scripts

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

Syntax

public event ASPxClientWebDocumentViewerCustomizeElementsEventHandler CustomizeElements

The event handler receives an argument of the ASPxClientWebDocumentViewerCustomizeElementsEventHandler type.

The event argument provides access to the ASPxClientCustomizeElementsEventArgs.Elements collection containing all available elements of the Web Document Viewer.

The ASPxClientCustomizeElementsEventArgs.GetById method allows you to obtain the required element by its ID using the DevExpress.Report.Preview.PreviewElements object. The following elements are available within this object:

  • RightPanel - corresponds to the panel at the right of the Viewer and containing tabs with the Document Map, Parameters and Export Options.
  • Surface - corresponds to the Viewer's central part displaying the report document.
  • Toolbar - corresponds to the Document Viewer's Toolbar.

The code sample below demonstrates how to use the CustomizeElements event to hide the Document Viewer Toolbar.

<script type="text/javascript" id="script">
    function customizeElements(s, e) {
        var toolbarPart = e.GetById(DevExpress.Report.Preview.PreviewElements.Toolbar);
        var index = e.Elements.indexOf(toolbarPart);
        e.Elements.splice(index, 1);
    }
</script>

<dx:ASPxWebDocumentViewer ID="ASPxWebDocumentViewer1" runat="server" ReportSourceId="WebReportDesigner.XtraReport1">
     <ClientSideEvents CustomizeElements="customizeElements"/>
</dx:ASPxWebDocumentViewer>