EPR类企业管理系统

在我们现有系统基础上或全新开发,提供定制服务
为您的企业高效快速实施ERP,WMS,MES,CRM管理系统
全面管控物料仓库、销售业务、采购业务、仓库业务
生产过程、质量检验、组织架构、业务报表


定制
QQ:460-3528

开发
QQ群:3360-90194

源码
微信:136-3650-3721

如何:访问WinForms仪表板设计器

本主题介绍如何自定义DashboardDesigner控件,该控件用于在WinForms XAF应用程序中创建和修改仪表板。

仪表板WinDesigner

注意

在ASP.NET应用程序中,ASPxDashboard控件用于同时查看和设计仪表板。您可以使用WebDashboardViewerViewItem视图项来访问它(请参阅如何:访问仪表板控件)。

  • 在Windows窗体模块中,添加仅在IDashboardData视图中激活的控制器。
  • 使用Frame.GetController <ControllerType>方法访问WinShowDashboardDesignerController
  • 使用WinShowDashboardDesignerController.DashboardDesignerManager属性访问DashboardDesignerManager对象。
  • 处理DashboardDesignerManager.DashboardDesignerCreated事件,并使用DashboardDesigner事件参数访问DashboardDesigner对象。
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(); 
    } 
}

转载保留此链接,注明出处