This tutorial shows how to create the dashboard web application using the ASPxDashboard control.
Download the completed project: Creating an ASP.NET Web Forms Dashboard Designer Application
Watch the video: Dashboards: Creating a Web Designer & Viewer
Add a new Web Form to the application. To do this, right-click the project in the Solution Explorer and select Add | Web Form.
Leave the default 'WebForm1' item name and click OK in the invoked dialog.
Drag the ASPxDashboard control from the DX.18.2: Data & Analytics Toolbox tab and drop it onto the page.
Switch the web page to the Design view.
Click the control's smart tag and set Dashboard Storage Folder to the following relative path: ~/App_Data/Dashboards.
This folder contains the saved dashboards' XML definitions.
Right-click the App_Data folder, select Add | Existing Item and locate the nwind.mdb database using the following path:
C:\Users\Public\Documents\DevExpress Demos 18.2\Components\Data\nwind.mdb
Specify a connection string to the added database within the project's Web.config file as shown below.
<connectionStrings> <add name="nwindConnection" connectionString="XpoProvider=MSAccess; Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|\nwind.mdb;" /> </connectionStrings>
Note that the connection string should contain the XpoProvider parameter that depends on the used database type. For details on how to specify connection strings for different database types, see Register Default Data Connections.
In the Page_Load method of WebForm1.aspx.cs, pass the ConfigFileConnectionStringsProvider instance as the SetConnectionStringsProvider method's parameter to to allow creating new data sources based on connection strings from the Web.config file:
In the web application's Web.Config file, go to the DevExpress section and add the "resources" section as shown below.
<devExpress> <!-- ... --> <resources> <add type="ThirdParty" /> <add type="DevExtreme" /> </resources> </devExpress>
This adds the required client libraries to the project, such as jquery, jquery-ui, knockout and globalize.
The basic cldr content needed for the Web Dashboard is included in the library. However, for locales other than "en" (or currencies other than "USD"), cldr content should be loaded additionally (read more in the Globalize documentation).
The designer application is now ready. Build and run the project.
Your application should look as follows:
For instructions on how to create your first dashboard in the Web Designer, go to Create a Dashboard using the Web Dashboard.
After you create and save a dashboard, you can now switch your Dashboard Designer application to the Viewer mode.
Set the Working Mode option to the 'ViewerOnly'.