dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-7a738c76.md
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
public event CustomizeDashboardItemCaptionEventHandler CustomizeDashboardItemCaption
Public Event CustomizeDashboardItemCaption As CustomizeDashboardItemCaptionEventHandler
The CustomizeDashboardItemCaption event's data class is CustomizeDashboardItemCaptionEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| DashboardItemName | Gets the name of the current dashboard item. |
| FilterText | 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. Inherited from CustomizeDashboardCaptionBaseEventArgs. |
| Items | Provides access to command buttons located in the dashboard title or in the dashboard item’s caption. Inherited from CustomizeDashboardCaptionBaseEventArgs. |
| Text | Gets or sets the text displayed in the dashboard title or the dashboard item caption. Inherited from CustomizeDashboardCaptionBaseEventArgs. |
| Visible | Gets or sets whether the current dashboard item’s caption is shown, |
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.
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
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);
}
}
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.
dashboardDesigner1.DashboardItemSelectionChanged += DashboardDesigner1_DashboardItemSelectionChanged;
dashboardDesigner1.CustomizeDashboardItemCaption += DashboardDesigner1_CustomizeDashboardItemCaption;
dashboardDesigner1.ConfigureDataConnection += DashboardDesigner1_ConfigureDataConnection;
AddHandler dashboardDesigner1.DashboardItemSelectionChanged, AddressOf DashboardDesigner1_DashboardItemSelectionChanged
AddHandler dashboardDesigner1.CustomizeDashboardItemCaption, AddressOf DashboardDesigner1_CustomizeDashboardItemCaption
AddHandler dashboardDesigner1.ConfigureDataConnection, AddressOf DashboardDesigner1_ConfigureDataConnection
See Also