Skip to main content
A newer version of this page is available. .

Dashboard Title - Customization

  • 3 minutes to read

The Dashboard Title can contain text, images and command buttons. Built-in functionality and settings which persist and can be saved in the dashboard definition file are described in the Dashboard Title topic.

You can also customize the dashboard title in your application at runtime by handling the DashboardDesigner.CustomizeDashboardTitle event. This approach allows you to modify the text displayed in the title, deliberately hide command buttons, and add custom buttons and drop-down menus to perform actions which can benefit end-users.

The following properties are accessible in the CustomizeDashboardTitle event handler:

e.Text

The text displayed in the dashboard title.

e.FilterText

The text displayed in the title that identifies a single master filter value applied to the dashboard. When several filters are apllied, the text is not displayed. However, you can modify the built-in behavior and provide any relevant text.

e.Items

Provides access to a collection of items (command buttons and other bar items) located in the dashboard title. You can modify the collection to remove or add built-in or custom items.

Example 1 - How to Delay Data Load Until All Filters are Set

This example demonstrates how to load data in the Dashboard designer on demand when all required filters are set. For this, the Show Data button is created in the DashboardDesigner.CustomizeDashboardTitle event handler.

View Example: WinForms Dashboard - How to delay data load until all filters are set

using DevExpress.DashboardWin;
using System;
using System.Linq;

namespace CustomShowDataExample
{
    public partial class DesignerForm1 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public DesignerForm1()
        {
            InitializeComponent();
            dashboardDesigner.CustomizeDashboardTitle += DashboardDesigner_CustomizeDashboardTitle;
            dashboardDesigner.LoadDashboard(@"..\..\Dashboards\dashboard1.xml");
        }

        #region #CustomizeDashboardTitle
        private void DashboardDesigner_CustomizeDashboardTitle(object sender, CustomizeDashboardTitleEventArgs e)
        {
            DevExpress.Data.IParameter showDataParameter = dashboardDesigner.Parameters.FirstOrDefault(p => p.Name == "ShowData");
            if (showDataParameter != null)
            {
                bool showData = (bool)showDataParameter.Value;
                DashboardToolbarItem showDataItem = new DashboardToolbarItem(showData, "Select states in the State list box and click this button to display data",
                    new Action<DashboardToolbarItemClickEventArgs>((args) => {
                        showDataParameter.Value = !showData;
                    }));
                showDataItem.Caption = "Show Data";
                showDataItem.SvgImage = svgImageCollection1[0];
                e.Items.Insert(0, showDataItem);
            }
        }
        #endregion #CustomizeDashboardTitle
    }
}

Example 2 - How to Navigate Tabs using Custom Tab Header Buttons or Set Up a Slide Show

This example illustrates methods and events used to manage the selected tabs.

View Example

See Also