ASPxDashboardViewer.ConfigureDataConnection Event

Allows you to customize connection settings before the ASPxDashboardViewer connects to a data store (database, OLAP cube, etc.).

Namespace: DevExpress.DashboardWeb

Assembly: DevExpress.Dashboard.v18.1.Web.WebForms.dll

Syntax

public event ConfigureDataConnectionWebEventHandler ConfigureDataConnection

The event handler receives an argument of the ConfigureDataConnectionWebEventHandler type.

The ConfigureDataConnection event is raised before the connection to a data store is established and allows you to customize connection settings.

To specify connection parameters, you have to cast an object returned by the e.ConnectionParameters property to a proper type, depending on the data source type, as the following table illustrates.

Data Source

Parameter Type

SQL Data Source

The base type is the SqlServerConnectionParametersBase class which defines the basic connection parameters: DatabaseName, Password, ServerName and UserName. To specify other data provider parameters, cast an object to any of the following types:

OLAP Data Source

To specify the OLAP connection string, cast an object to the OlapConnectionParameters type and use the ConnectionString property.

Excel Data Source

To specfy a path to a Microsoft Excel workbook/CSV file, cast an object to the ExcelDataSourceConnectionParameters type and use the FileName and Password properties.

Extract Data Source

To specfy a path to a data extract file and a data driver to access the data, cast an object to the ExtractDataSourceConnectionParameters type and use the FileName and DriverName properties.

Entity Framework Data Source

Event does not occur.

Object Data Source

Event does not occur.

Handle the DataLoading event instead.

This event is raised when the dashboard is supplied with data using one of the following data source types:

Note

If the dashboard is supplied with data using the DashboardObjectDataSource data source, the Dashboard.DataLoading event is fired instead.