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

Access the WinForms Dashboard Designer

  • 2 minutes to read

This topic describes how to customize the DashboardDesigner control used to create and modify dashboards in WinForms XAF applications.

DashboardWinDesigner

Note

In ASP.NET Web Forms applications, the ASPxDashboard control is used to view and design dashboards simultaneously. You can access it using the WebDashboardViewerViewItem View Item (see How to: Access the Dashboard Control).

  • In a Windows Forms module, add a Controller that is activated in the IDashboardData Views only.
  • Access the WinShowDashboardDesignerController using the Frame.GetController<ControllerType> method.
  • Access the DashboardDesignerManager object using the WinShowDashboardDesignerController.DashboardDesignerManager property.
  • Handle the DashboardDesignerManager.DashboardDesignerCreated event and access the DashboardDesigner object using the DashboardDesigner event argument.
using DevExpress.DashboardWin; 
using DevExpress.ExpressApp; 
using DevExpress.ExpressApp.Dashboards.Win; 
using DevExpress.Persistent.Base; 
// ... 
public class CustomizeDashboardDesigner : ObjectViewController<ObjectView, IDashboardData> { 
    protected override void OnActivated() { 
        base.OnActivated(); 
        WinShowDashboardDesignerController showDashboardDesignerController = 
             Frame.GetController<WinShowDashboardDesignerController>();
        if (showDashboardDesignerController != null) { 
            showDashboardDesignerController.DashboardDesignerManager.DashboardDesignerCreated += 
                DashboardDesignerManager_DashboardDesignerCreated; 
        }
    } 
    private void DashboardDesignerManager_DashboardDesignerCreated(object sender, DashboardDesignerShownEventArgs e) { 
        e.DashboardDesigner.ActionOnClose = DashboardActionOnClose.Save; 
    } 
    protected override void OnDeactivated() { 
        WinShowDashboardDesignerController showDashboardDesignerController = 
            Frame.GetController<WinShowDashboardDesignerController>(); 
        if (showDashboardDesignerController != null) { 
            showDashboardDesignerController.DashboardDesignerManager.DashboardDesignerCreated -= 
                DashboardDesignerManager_DashboardDesignerCreated; 
        }
        base.OnDeactivated(); 
    } 
}