EPR类企业管理系统

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


定制
QQ:460-3528

开发
QQ群:3360-90194

源码
微信:136-3650-3721

如何:访问仪表板控件

本主题介绍如何访问WinForms应用程序中的DashboardViewer控件和ASP.NET应用程序中的ASPxDashboard控件。

注意

有关如何访问DashboardDesigner控件的详细信息,请参考如何:访问WinForms Dashboard Designer主题。

重点

在继续之前,请确保:

  • 您的WinForms模块项目引用了DevExpress.Dashboard.v 19.2 .Win.dllDevExpress.ExpressApp.Dashboards.Win.v 19.2 .dll程序集;
  • 您的ASP.NET模块项目引用了DevExpress.Dashboard.v 19.2 .Web.dllDevExpress.ExpressApp.Dashboards.Web.v 19.2 .dll程序集。

请在WinForms和ASP.NET模块项目中执行以下步骤以访问仪表板控件:

using System;
using DevExpress.DashboardWin;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Dashboards.Win;
using DevExpress.Persistent.Base;
// ...
public class WinDashboardController : ObjectViewController<DetailView, IDashboardData> {
    private WinDashboardViewerViewItem dashboardViewerViewItem;
    protected override void OnActivated() {
        base.OnActivated();
        dashboardViewerViewItem = View.FindItem("DashboardViewer") as WinDashboardViewerViewItem;
        if(dashboardViewerViewItem != null) {
            if(dashboardViewerViewItem.Viewer != null) {
                CustomizeDashboardViewer(dashboardViewerViewItem.Viewer);
            }
            else {
                dashboardViewerViewItem.ControlCreated  = DashboardViewerViewItem_ControlCreated;
            }
        }
    }
    private void DashboardViewerViewItem_ControlCreated(object sender, EventArgs e) {
        CustomizeDashboardViewer(((WinDashboardViewerViewItem)sender).Viewer);
    }
    private void CustomizeDashboardViewer(DashboardViewer dashboardViewer) {
        dashboardViewer.AllowPrintDashboardItems = true;
    }
    protected override void OnDeactivated() {
        if(dashboardViewerViewItem != null) {
            dashboardViewerViewItem.ControlCreated -= DashboardViewerViewItem_ControlCreated;
            dashboardViewerViewItem = null;
        }
        base.OnDeactivated();
    }
}

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