Dashboard for Web Forms - How to replace DashboardSqlDataSource with DashboardObjectDataSource with filtered data
DashboardSqlDataSource allows requesting data in two ways:
1. Direct database connection: Server Mode.
2. In-memory data processing: Client Mode.
The first approach works if you configure the data source using the Query Builder. In this case, it is possible to add a custom filter expression to filter requested data using the CustomFilterExpression event.
If you load data using a custom SQL query or a stored procedure, only Client Data Processing Mode is supported. This example demonstrates how to filter data requested from a database manually and pass it to a dashboard as DashboardObjectDataSource.
To accomplish this task it is necessary to define a custom DashboardStorage class and implement the LoadDashboard method to update loaded dashboards and replace the target DashboardSqlDataSource queries with new DashboardObjectDataSources.
Then, handle the DataLoading event to provide data to the new object data sources. To learn how to request data using DashboardSqlDataSource, refer to the T347509: How to get data from the Dashboard DataSource and convert it to DataTable thread.
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
- How to Register Data Sources for ASP.NET Web Forms Dashboard Control
- Dashboard for Web Forms - How to connect the Web Dashboard to an SQL database
(you will be redirected to DevExpress.com to submit your response)