Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Show a Custom Form with the WinForms Dashboard Designer

  • 2 minutes to read

This topic describes how to show a custom form as the WinForms Dashboard Designer used to create and modify dashboards in WinForms XAF applications. For instance, it can be required for customizing the menu (adding custom bar items or removing certain default bar items).

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Dashboards.Win;
using DevExpress.Persistent.Base;
// ...
public class CustomDashboardDesignerFormController : ObjectViewController<ObjectView, IDashboardData> {
    private WinShowDashboardDesignerController showDashboardDesignerController;
    protected override void OnActivated() {
        base.OnActivated();
        showDashboardDesignerController = Frame.GetController<WinShowDashboardDesignerController>();
        if(showDashboardDesignerController != null) {
            showDashboardDesignerController.DashboardDesignerManager.CreateCustomForm += Manager_CreateCustomForm;
        }
    }
    private void Manager_CreateCustomForm(object sender, CreateCustomFormEventArgs e) {
        e.Form = new CustomDashboardDesignerForm();
    }
    protected override void OnDeactivated() {
        base.OnDeactivated();
        if(showDashboardDesignerController != null) {
            showDashboardDesignerController.DashboardDesignerManager.CreateCustomForm -= Manager_CreateCustomForm;
        }
    }
}
using DevExpress.DashboardWin;
// ...
public partial class CustomDashboardDesignerForm : DevExpress.XtraBars.Ribbon.RibbonForm {
    public CustomDashboardDesignerForm() {
        InitializeComponent();
    }
    public DashboardDesigner Designer {
        get { return dashboardDesigner; }
    }
}