Back to Devexpress

DashboardDesigner.CustomizeDashboardItemCaption Event

dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-7a738c76.md

latest8.0 KB
Original Source

DashboardDesigner.CustomizeDashboardItemCaption Event

Allows you to customize the dashboard item caption at runtime.

Namespace : DevExpress.DashboardWin

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

NuGet Package : DevExpress.Win.Dashboard

Declaration

csharp
public event CustomizeDashboardItemCaptionEventHandler CustomizeDashboardItemCaption
vb
Public Event CustomizeDashboardItemCaption As CustomizeDashboardItemCaptionEventHandler

Event Data

The CustomizeDashboardItemCaption event's data class is CustomizeDashboardItemCaptionEventArgs. The following properties provide information specific to this event:

PropertyDescription
DashboardItemNameGets the name of the current dashboard item.
FilterTextGets 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. Inherited from CustomizeDashboardCaptionBaseEventArgs.
ItemsProvides access to command buttons located in the dashboard title or in the dashboard item’s caption. Inherited from CustomizeDashboardCaptionBaseEventArgs.
TextGets or sets the text displayed in the dashboard title or the dashboard item caption. Inherited from CustomizeDashboardCaptionBaseEventArgs.
VisibleGets or sets whether the current dashboard item’s caption is shown,

Remarks

This event occurs when the DashboardDesigner loads a dashboard (the DashboardDesigner.Dashboard property changes) or when end-user activities affect the dashboard item caption. Such activities include master filter, drill-down or parameter value change.

Tip

You can change the displayed text, remove existing buttons, add command buttons or command bar items, including drop-down menus.

Example

This code snippet demonstrates how to handle the DashboardDesigner.CustomizeDashboardItemCaption event to display the dashboard parameter’s value in the caption’s area designed to display the filter value.

View Example: How to Use Dashboard Items in Tab Pages as Independent Master Filters

csharp
using DevExpress.DashboardCommon;
using DevExpress.DashboardCommon.ViewerData;
using DevExpress.DashboardWin;
// ...
        dashboardDesigner1.CustomizeDashboardItemCaption += DashboardDesigner1_CustomizeDashboardItemCaption;
// ...
        private void DashboardDesigner1_CustomizeDashboardItemCaption(object sender, CustomizeDashboardItemCaptionEventArgs e)
        {
            DashboardDesigner dDesigner = sender as DashboardDesigner;
            if (e.DashboardItemName == "chartDashboardItem1" && dDesigner.Parameters.Count > 0)
            {
                e.FilterText = string.Format(" {0}", dDesigner.Parameters[0].SelectedValue);
            }
        }
vb
Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardCommon.ViewerData
Imports DevExpress.DashboardWin
' ...
        AddHandler dashboardDesigner1.CustomizeDashboardItemCaption, AddressOf DashboardDesigner1_CustomizeDashboardItemCaption
' ...
        Private Sub DashboardDesigner1_CustomizeDashboardItemCaption(ByVal sender As Object, ByVal e As CustomizeDashboardItemCaptionEventArgs)
            Dim dDesigner As DashboardDesigner = TryCast(sender, DashboardDesigner)
            If e.DashboardItemName = "chartDashboardItem1" AndAlso dDesigner.Parameters.Count > 0 Then
                e.FilterText = String.Format(" {0}", dDesigner.Parameters(0).SelectedValue)
            End If
        End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomizeDashboardItemCaption event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-designer-custom-interactivity-in-tab-pages/CS/CustomInteractivityExample/Form1.cs#L18

csharp
dashboardDesigner1.DashboardItemSelectionChanged += DashboardDesigner1_DashboardItemSelectionChanged;
dashboardDesigner1.CustomizeDashboardItemCaption += DashboardDesigner1_CustomizeDashboardItemCaption;
dashboardDesigner1.ConfigureDataConnection += DashboardDesigner1_ConfigureDataConnection;

winforms-dashboard-designer-custom-interactivity-in-tab-pages/VB/CustomInteractivityExample/Form1.vb#L18

vb
AddHandler dashboardDesigner1.DashboardItemSelectionChanged, AddressOf DashboardDesigner1_DashboardItemSelectionChanged
AddHandler dashboardDesigner1.CustomizeDashboardItemCaption, AddressOf DashboardDesigner1_CustomizeDashboardItemCaption
AddHandler dashboardDesigner1.ConfigureDataConnection, AddressOf DashboardDesigner1_ConfigureDataConnection

Implements

CustomizeDashboardItemCaption

See Also

Title and Item Captions

DashboardDesigner Class

DashboardDesigner Members

DevExpress.DashboardWin Namespace