public static void ConfigureDataSource(DataSourceInMemoryStorage storage)
        {
            // Registers an XPO data source.
            DashboardXpoDataSource xpoDataSource = new DashboardXpoDataSource("XPO Data Source");

            xpoDataSource.ConnectionStringName = "NWindConnectionString";
            xpoDataSource.SetEntityType(typeof(Category));
            storage.RegisterDataSource("xpoDataSource", xpoDataSource.SaveToXml());
        }
        public static DashboardXpoDataSource CreateXpoDataSource()
        {
            DashboardXpoDataSource dataSource = new DashboardXpoDataSource()
            {
                ConnectionStringName = "northwind"
            };

            dataSource.SetEntityType(typeof(nwind.Customers));
            return(dataSource);
        }
Exemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DashboardFileStorage dashboardFileStorage = new DashboardFileStorage("~/App_Data/Dashboards");

            ASPxDashboardXpo.SetDashboardStorage(dashboardFileStorage);

            // Uncomment the next line to allow users to create new data sources based on predefined connection strings.
            //ASPxDashboardXpo.SetConnectionStringsProvider(new DevExpress.DataAccess.Web.ConfigFileConnectionStringsProvider());

            // Create a data source storage.
            DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();

            // Register an XPO data source.
            DashboardXpoDataSource xpoDataSource = new DashboardXpoDataSource("XPO Data Source");

            xpoDataSource.ConnectionStringName = "NWindConnectionStringSQLite";
            xpoDataSource.SetEntityType(typeof(Category));
            dataSourceStorage.RegisterDataSource("xpoDataSource", xpoDataSource.SaveToXml());

            // Set the configured data source storage.
            ASPxDashboardXpo.SetDataSourceStorage(dataSourceStorage);

            ASPxDashboardXpo.InitialDashboardId = "dashboardXpo";
        }