Skip to content

Commit 1399174

Browse files
for editing
1 parent ec3e8c9 commit 1399174

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

Readme.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,39 @@
33
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T386418)
44
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
55
<!-- default badges end -->
6+
# Dashboard for Web Forms - How to Load and Save Dashboards from/to a Database
67

8+
This example shows how to create a custom dashboard storage that allows you to store dashboards in a database.
9+
10+
<!-- default file list -->
11+
## Files to Look At
12+
13+
* [DataBaseEditaleDashboardStorage.cs](./CS/DataBaseEditaleDashboardStorage.cs) (VB: [DataBaseEditaleDashboardStorage.vb](./VB/DataBaseEditaleDashboardStorage.vb))
14+
* [Global.asax.cs](./CS/Global.asax.cs) (VB: [Global.asax.vb](./VB/Global.asax.vb))
15+
<!-- default file list end -->
16+
17+
## Example Overview
18+
19+
The example uses the [System.Data.SqlClient](https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient?redirectedfrom=MSDN&view=net-5.0) members to connect and operate an MS SQL server database.
20+
21+
A custom dashboard storage should implement one of the following interfaces: [IDashboardStorage](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IDashboardStorage) or [IEditableDashboardStorage](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IEditableDashboardStorage).
22+
23+
The following API used in the example:
24+
25+
- [LoadDashboard](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IDashboardStorage.LoadDashboard(System.String)) 
26+
27+
Returns a dashboard by its ID in the XDocument format, which describes an object model of the dashboard.
28+
- [GetAvailableDashboardsInfo](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IDashboardStorage.GetAvailableDashboardsInfo) 
29+
30+
Returns a list of IDs and Captions of dashboards available in the data storage.
31+
- [SaveDashboard](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IDashboardStorage.SaveDashboard(System.String-System.Xml.Linq.XDocument)) 
32+
33+
Updates the dashboard with new settings by its id.
34+
- [AddDashboard](https://docs.devexpress.com/Dashboard/DevExpress.DashboardWeb.IEditableDashboardStorage.AddDashboard(System.Xml.Linq.XDocument-System.String))
35+
36+
Takes a dashboard definition with its caption, saves it to the data storage, and returns the ID of a new saved dashboard.
37+
38+
Additionally, this example contains an SQL file ([SavedDashboards.sql](./CS/SavedDashboards.sql)), which can be used to recreate a database used in this example on your side. Do no forget to update the connection string in the **Web.config** file to make it valid in your environment.
739

840

941
## Documentation

0 commit comments

Comments
 (0)