Skip to main content
All docs
V23.2

Dashboards Module Troubleshooting Guide

  • 2 minutes to read

This topic describes common issues that you may encounter when using the Dashboards Module, and steps you can follow to diagnose and resolve these issues.


The “Your XAF application contains the Dashboards Module and DevExtreme widget” error message is displayed

Problem Description:

An ASP.NET Core Blazor-based XAF application displays the following error message if you add both the Dashboards Module and DevExtreme widget to it:

Your XAF application contains the Dashboards Module and DevExtreme widget. This scenario requires additional setup as described in the following topic: <link>.

Solution:

Follow the steps below to properly configure such applications:

  1. Add the following code that implements a custom controller to the MySolution.Blazor.Server project.

    using DevExpress.DashboardBlazor;
    using DevExpress.ExpressApp;
    using DevExpress.ExpressApp.Dashboards.Blazor.Components;
    using Microsoft.AspNetCore.Components;
    
    public class MyController : ViewController<DetailView> {
        protected override void OnActivated() {
            base.OnActivated();
            View.CustomizeViewItemControl<BlazorDashboardViewerViewItem>(this, CustomizeDashboardViewerViewItem);
        }
        void CustomizeDashboardViewerViewItem(BlazorDashboardViewerViewItem dashboardViewItem) {
            if(dashboardViewItem.Control is DxDashboardViewerAdapter adapter) {
                adapter.JSCustomizationModel.OnScriptsLoading =
                    EventCallback.Factory.Create<ScriptsLoadingEventArgs>(this, OnScriptsLoading);
            }
        }
        private void OnScriptsLoading(ScriptsLoadingEventArgs args) {
            args.Scripts.Remove(ScriptIdentifiers.JQuery);
            args.Scripts.Remove(ScriptIdentifiers.Knockout);
            args.Scripts.Remove(ScriptIdentifiers.DevExtreme);
        }
    }
    
  2. Import the JQuery and Knockout libraries into the MySolution.Blazor.Server\Pages_Host.cshtml file before the DevExtreme library .

    <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-3.6.2.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.0/knockout-min.js"></script>
    <script type="text/javascript" src="https://cdn3.devexpress.com/jslib/23.2.6/js/dx.all.js"></script>
    
  3. Rebuild and run the application.


If this document does not contain sufficient information on how to resolve your issue, feel free to contact Developer Express support engineers at the Support Center.