Skip to main content

BeforeExportDocumentEventArgs.HideItem(Predicate<DashboardItem>) Method

Hides the dashboard item matching the specified predicate in the exported dashboard.

Namespace: DevExpress.DashboardCommon

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

NuGet Package: DevExpress.Dashboard.Core

Declaration

public void HideItem(
    Predicate<DashboardItem> match
)

Parameters

Name Type Description
match Predicate<DashboardItem>

A System.Predicate that specifies the condition used to determine whether to hide the dashboard item.

Example

This example demonstrates how to hide dashboard filter items when a dashboard is exported to PDF and the ExportFilters export option is set to false.

This method can be the used to handle the following events:

using DevExpress.DashboardCommon;
// ...
        dashboardDesigner1.BeforeExportDocument += DashboardDesigner1_BeforeExportDocument;
// ...
    private void DashboardDesigner1_BeforeExportDocument(object sender, BeforeExportDocumentEventArgs e)
    {
        if (e.ExportAction == DashboardExportAction.ExportToPdf &&
            e.PdfExportOptions.ExportFilters == false)
        {
            e.HideItem(item => item is FilterElementDashboardItem ||
            item is DateFilterDashboardItem);
        }
    }
See Also