Back to Devexpress

Object Data Source

dashboard-401435-web-dashboard-integrate-dashboard-component-dashboard-backend-prepare-data-source-storage-for-the-aspnet-mvc-framework-object-data-source.md

latest1.9 KB
Original Source

Object Data Source

  • Feb 27, 2023
  • 3 minutes to read

This tutorial shows how to add the DashboardObjectDataSource to an in-memory data source storage, and make it available to users.

  1. In your application, create the SalesPersonData class and add the following code:

  2. In the dashboard configuration file (for example, DashboardConfig.cs), create a public method that returns the configured dashboard’s data source storage (DataSourceInMemoryStorage) and define the Object data source.

  3. Call the DashboardConfigurator.SetDataSourceStorage method to configure the data source storage. Use the created CreateDataSourceStorage method as the SetDataSourceStorage parameter and handle the DashboardConfigurator.DataLoading event to supply the dashboard with actual data at runtime.

The Object Data Source is now available in the Web Dashboard:

Users can bind dashboard items to data in the Web Dashboard’s UI.

Example

The example shows how to make a set of data sources available for users in the Web Dashboard application.

View Example: How to Register Data Sources for the ASP.NET MVC Dashboard Extension