The requested page is not available for the requested platform. You are viewing the content for Default platform.

CustomizeDashboardCaptionBaseEventArgs.FilterText Property

Gets or sets the text displayed in the dashboard title or in the dashboard item caption. The text identifies a single master filter value applied to the dashboard.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v19.2.Win.dll

Declaration

public string FilterText { get; set; }
Public Property FilterText As String

Property Value

Type Description
String

Remarks

The following image demonstrates the location of a text obtained from the FilterText value. The text is displayed in the dashboard title if a master filter contains a single filter value. In the picture, it equals the state New Hampshire.

Handle the DashboardViewer.CustomizeDashboardTitle and DashboardDesigner.CustomizeDashboardTitle events to specify the text displayed in the dashboard title.

Handle the DashboardViewer.CustomizeDashboardItemCaption and DashboardDesigner.CustomizeDashboardItemCaption events to specify the text displayed in the dashboard item caption.

Examples

This example calculates a total value (distinct count) for a hidden measure and display it in the dashboard item's caption.

Note

The complete sample project How to Calculate and Display Totals for the Hidden Measure is available in the DevExpress Examples repository.

using DevExpress.DashboardCommon;
using DevExpress.DashboardCommon.ViewerData;
using DevExpress.DashboardWin;
using System.Data;
using System.IO;
using System.Linq;
using System.Windows.Forms;

namespace CalculateHIddenTotalsExample
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            dashboardViewer1.CalculateHiddenTotals = true;
            dashboardViewer1.ConfigureDataConnection += DashboardViewer1_ConfigureDataConnection;
            dashboardViewer1.CustomizeDashboardItemCaption += DashboardViewer1_CustomizeDashboardItemCaption;

            // Load the dashboard after all DashboardViewer options are set.
            dashboardViewer1.DashboardSource = typeof(Dashboard1);
        }
        private void DashboardViewer1_CustomizeDashboardItemCaption(object sender, CustomizeDashboardItemCaptionEventArgs e)
        {
            DashboardViewer viewer = (DashboardViewer)sender;
            if (e.DashboardItemName == "pieDashboardItem1")
            {
                DashboardToolbarItem infoButton = new DashboardToolbarItem();
                MultiDimensionalData mData = viewer.GetItemData(e.DashboardItemName);
                var orderCount = mData.GetValue(mData.GetMeasures().Where(m => m.DataMember == "OrderID").First()).Value ?? 0;
                e.FilterText += string.Format("{0:N0} distinct orders are displayed", orderCount);
            }
        }

        private void DashboardViewer1_ConfigureDataConnection(object sender, DashboardConfigureDataConnectionEventArgs e)
        {
            ExtractDataSourceConnectionParameters parameters = e.ConnectionParameters as ExtractDataSourceConnectionParameters;
            if (parameters != null) parameters.FileName = Path.GetFileName(parameters.FileName);
        }

    }
}
See Also