-
Notifications
You must be signed in to change notification settings - Fork 0
/
XpoDashboard.aspx.cs
29 lines (23 loc) · 1.38 KB
/
XpoDashboard.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using System;
namespace WebFormsDashboardDataSources.Pages {
public partial class XpoDashboard : System.Web.UI.Page {
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";
}
}
}