You are viewing help content for pre-release software. This document and the features it describes are subject to change. Switch to the current version.

Dashboards Module

  • 5 minutes to read

The Dashboards Module allows you to integrate DevExpress Dashboard controls with WinForms, ASP.NET Web Forms, and ASP.NET Core Blazor XAF applications.

Dashboards_XCRM

The Dashboards Module is demonstrated in the Dashboards section of the Feature Center application. The Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 21.2\Components.NET Core Desktop Libraries\eXpressApp Framework\FeatureCenter by default. The ASP.NET Web Forms version of this demo is available online at https://demos.devexpress.com/XAF/FeatureCenter/.

Dashboards Module Capabilities

For end-users:

For developers:

  • Create dashboards at runtime and persist them. Dashboards are stored with other business objects in the application database.
  • View and modify existing dashboards in the Dashboards List View. You can use the Dashboards navigation item to invoke this View.
  • Create predefined dashboards that are available to users after an application’s deployment.
  • Create navigation items associated with individual dashboards.
  • Customize the dashboard’s control options and behavior.

Note

Note that the DashboardView Views and Dashboard Module are different XAF concepts. Dashboard Views display several XAF Views in a single Frame - they do not utilize DevExpress Dashboard controls.

Dashboards Module Components

Modules

Platform Module
platform-agnostic DashboardsModule
WinForms DashboardsWindowsFormsModule
ASP.NET Web Forms DashboardsAspNetModule
ASP.NET Core Blazor DashboardsBlazorModule

Integrated DevExpress Controls

  • DashboardDesigner - used to design dashboards in a WinForms application.
  • DashboardViewer - used to view dashboards in a WinForms application.
  • ASPxDashboard - used to view and create dashboards in an ASP.NET Web Forms application.
  • DxDashboard - used to view and create dashboards in an ASP.NET Core Blazor application.

Note

You cannot localize the ASPxDashboard control in the Model Editor because it does not have a corresponding Localizer Object. For more information, refer to the following help topic: Dashboard | Localization.

View Items

The Dashboards Module uses the following View Items to host dashboard controls in WinForms, ASP.NET Web Forms, and ASP.NET Core Blazor XAF applications:

Application Model Extensions

The Dashboards Module extends the Application Model with the IModelDashboardNavigationItem node and adds the IModelClassDashboardsVisibility.IsVisibleInDashboards property to the IModelClass node.

Dashboard Data Type

The Module uses the following built-in business objects (entities) that implement the IDashboardData interface to store dashboards:

You can also use a custom dashboard data type. To do this, inherit DashboardData or implement the IDashboardData interface and pass the implemented type to the DashboardsModule.DashboardDataType property.

Tip

To display the DashboardData object’s Detail View, use a technique listed in the following help topic: Ways to Show a View.

Add the Dashboards Module to Your Application

Follow the steps below to add the Dashboards Module to your application. If you added this Module when you created an XAF application, the Solution Wizard generates the following code automatically:

  1. Add the following NuGet packages:

    Package

    Project

    DevExpress.ExpressApp.Dashboards

    platform-agnostic module project
    (MySolution.Module)

    DevExpress.ExpressApp.Dashboards.Blazor

    Blazor-specific module project
    (MySolution.Blazor.Server)

    DevExpress.ExpressApp.Dashboards.Win

    WinForms-specific module project
    (MySolution.Win)

    DevExpress.ExpressApp.Dashboards.Web

    ASP.NET Web Forms-specific module project
    (MySolution.Web)

  2. In the application constructor, add the platform agnostic and platform-specific Dashboards Modules to the Modules collection:

    WinForms
    File: MySolution.Win\WinApplication.cs.

    using DevExpress.ExpressApp.Dashboards;
    using DevExpress.ExpressApp.Dashboards.Win;
    // ...
    public partial class MySolutionWindowsFormsApplication : WinApplication {
        public MySolutionWindowsFormsApplication() {
            // ...
            Modules.Add(new DashboardsModule() { 
                // uncomment the following line in EF Core-based applications
                // DashboardDataType = typeof(DevExpress.Persistent.BaseImpl.EF.DashboardData) 
            });
            Modules.Add(new DashboardsWindowsFormsModule());
        }
        // ...
    }
    

    ASP.NET Web Forms
    File: MySolution.Web\WebApplication.cs.

    using DevExpress.ExpressApp.Dashboards;
    using DevExpress.ExpressApp.Dashboards.Web;
    // ...
    public partial class MySolutionAspNetApplication : WebApplication {
        public MySolutionAspNetApplication() {
            // ...
            Modules.Add(new DashboardsModule() { 
                // uncomment the following line in EF 6-based applications
                // DashboardDataType = typeof(DevExpress.Persistent.BaseImpl.EF.DashboardData) 
            });
            Modules.Add(new DashboardsAspNetModule());
        }
        // ...
    }
    

    ASP.NET Core Blazor
    File: MySolution.Blazor.Server\BlazorApplication.cs.

    using DevExpress.ExpressApp.Dashboards;
    using DevExpress.ExpressApp.Dashboards.Blazor;
    // ...
    public partial class MySolutionBlazorApplication : BlazorApplication {
        public MySolutionBlazorApplication() {
            // ...
            Modules.Add(new DashboardsModule() { 
                // uncomment the following line in EF Core-based applications
                // DashboardDataType = typeof(DevExpress.Persistent.BaseImpl.EF.DashboardData) 
            });
            Modules.Add(new DashboardsBlazorModule());
        }
        // ...
    }
    

    Tip

  3. In EF Core-based applications, register the DashboardData type in the application’s DbContext (the MySolution.Module\BusinessObjects\MySolutionDbContext.cs file).

    using DevExpress.Persistent.BaseImpl.EF;
    // ...
    public class MySolutionEFCoreDbContext : DbContext {
        // ...
        public DbSet<DashboardData> DashboardData { get; set; }
        // ...
    }
    
  4. In ASP.NET Core Blazor applications, do the following in the MySolution.Blazor.Server\Startup.cs file:

    • In the Startup.ConfigureServices method, call AddXafDashboards to register the required Dashboards Module services in IServiceCollection.
    • In the Startup.Configure method, call UseXafDashboards to register the DevExpress middleware.
    • In the Startup.Configure method, configure endpoints for the Dashboards Module.
    using DevExpress.ExpressApp.Dashboards.Blazor;
    // ...
    public class Startup {
        // ...
        public void ConfigureServices(IServiceCollection services){
            //...
            services.AddXafDashboards();
        }
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
            // ...
            app.UseXafDashboards();
            app.UseEndpoints(endpoints => {
                endpoints.MapXafDashboards();
                // ...
            }
        }
    }
    
See Also