protected override void CustomizeDashboardControl(ASPxDashboard dashboard)
 {
     if (Application.Model.Options is IModelOptionsXtraDashboards dashboardsOptions &&
         dashboardsOptions.XtraDashboards is IModelWebDashboardsOptions stateOptions && stateOptions.EnableStateRestore)
     {
         dashboard.SetInitialDashboardState += Dashboard_SetInitialDashboardState;
         dashboard.CustomDataCallback       += Dashboard_CustomDataCallback;
         dashboard.ClientSideEvents.DashboardStateChanged = $"function (s, e) {{s.PerformDataCallback('{dashboardStatePrefix}' + e.DashboardState, null);}}";
     }
 }
Exemplo n.º 2
0
        private void CustomizeDashboardViewer(ASPxDashboard dashboardControl)
        {
            XafCallbackManager callbackManager = ((ICallbackManagerHolder)WebWindow.CurrentRequestPage).CallbackManager;

            callbackManager.RegisterHandler(HandlerName, this);
            string widgetScript = @"function getOid(s, e) {{
                                        function findMeasure(measure) {{
                                            return measure.DataMember === 'Oid';
                                        }}
                                        if (e.ItemName.includes('gridDashboardItem')) {{
                                             var itemData = e.GetData(),
                                                dataSlice = itemData.GetSlice(e.GetAxisPoint()),
                                                oidMeasure = dataSlice.GetMeasures().find(findMeasure).Id,
                                                measureValue = dataSlice.GetMeasureValue(oidMeasure);
                                                {0}
                                        }}
                                    }}";

            dashboardControl.ClientSideEvents.ItemClick = string.Format(widgetScript, callbackManager.GetScript(HandlerName, "measureValue.GetValue()"));
        }
Exemplo n.º 3
0
        private ASPxDashboard GetASPxDashboardDesigner()
        {
            _dashboardDesigner = new ASPxDashboard {
                Width = Unit.Percentage(100),
                AllowOpenDashboard         = false,
                AllowCreateNewDashboard    = false,
                IncludeDashboardIdToUrl    = false,
                IncludeDashboardStateToUrl = false,
                WorkingMode         = GetWorkingMode(),
                MobileLayoutEnabled = ((IModelDashboardModuleASPxDashboard)((IModelApplicationDashboardModule)Model.Application).DashboardModule).MobileLayoutEnabled
            };
            var xpandDashboardDataProvider = ((XpandDashboardDataProvider)DashboardsModule.DataProvider);
            var dashboardCollectionDataSourceFillService = (IXpandDashboardDataSourceFillService)AttachService(xpandDashboardDataProvider);

            dashboardCollectionDataSourceFillService.FillService.LoadBeforeParameters += (sender, args) =>
                                                                                         args.Handled = new[] { RuleMode.Always, RuleMode.DesignTime }.Contains(Definition.EditParameters);
            _dashboard = Definition.GetDashboard(_application, RuleMode.DesignTime, dashboardCollectionDataSourceFillService,
                                                 editParameters: dashboard1 => {
                _dashboardHasParameters = dashboard1.Parameters.Any();
            });
            _dashboardDesigner.DashboardId = _dashboard.Title.Text;
            var dashboardStorage = new XpandDataSourceStorage(_application.Model);

            _dashboardDesigner.SetDataSourceStorage(dashboardStorage);
            _dashboardDesigner.CustomJSProperties += DashboardDesigner_CustomJSProperties;
            _dashboardDesigner.ClientSideEvents.DashboardInitialized =
                @"function(dashboardControl, e) {
                    if (dashboardControl.cpDashboardHasParameters)
                        dashboardControl.ShowParametersDialog();                                                                                                                        
                  }";
            _dashboardDesigner.DashboardAdding  += DashboardAdding;
            _dashboardDesigner.DashboardLoading += DashboardLoading;
            _dashboardDesigner.DashboardSaving  += DashboardSaving;


            return(_dashboardDesigner);
        }
Exemplo n.º 4
0
 protected override void CustomizeDashboardControl(ASPxDashboard dashboard)
 {
     dashboard.ConfigureDataConnection += Dashboard_ConfigureDataConnection;
     dashboard.DashboardLoading        += Dashboard_DashboardLoading;
 }
Exemplo n.º 5
0
        private void ConfigureDashboard(ASPxDashboard dashboardControl)
        {
            IDataSourceWizardConnectionStringsProvider provider = new ConfigFileConnectionStringsProvider();

            dashboardControl.SetConnectionStringsProvider(provider);
        }
Exemplo n.º 6
0
 private void SetHeight(ASPxDashboard dashboardControl)
 {
     dashboardControl.Height = 760;
 }
 protected abstract void CustomizeDashboardControl(ASPxDashboard dashboard);
 protected void Application_Start(object sender, EventArgs e)
 {
     ASPxDashboard.StaticInitialize();
 }