Skip to main content

How to Customize the Data Source Wizard

  • 3 minutes to read

The Data Source Wizard allows you to establish a connection and select data from various sources. You can use the DashboardDesigner.DataSourceWizard property to customize this wizard to skip certain pages, specify the list of available data providers, and so on.

The Data Source Wizard consists of the following main pages:

Database

  • The following page allows users to select connections specified in the application configuration file for the selected data connection type:

    DataSourceWizard_NewOrExistingConnection

    The Data Source Wizard does not initially show this page (the default setting). To display this page, set the DashboardDesignerDataSourceWizardSettings.ShowConnectionsFromAppConfig property to true.

    Important

    Note that you can disable the creation of new connections in the Data Source Wizard. For this, use the SqlWizardSettings.DisableNewConnections property. In this case, users can only select the data connection specified in the application configuration file.

  • If a user selected No, I’d like to specify the connection parameters myself option on the previous page, the following page is shown:

    DataSourceWizard_SQLite

    This page allows users to specify connection parameters for the selected data connection type.

  • The next page allows users to decide whether user credentials are saved in a dashboard definition.

    DataSourceWizard_SaveConnectionString

    The SqlWizardSettings.DatabaseCredentialsSavingBehavior property allows you to save user credentials.

  • The final page of the Data Source Wizard allows users to invoke the Query Builder and select data.

    MSSQL_CreateQuery_WithoutStoredProcedures

    Note that the Data Source Wizard and Query Builder do not allow users to specify SQL queries. To enable this feature, set the SqlWizardSettings.EnableCustomSql property to true.

    Warning

    The use of custom SQL queries can lead to inadvertent or unauthorized modifications to your data/database structure. Ensure that you follow best practices and implement the appropriate user read/write privileges at database level.

Entity Framework

  • For the Entity Framework data source, the invoked page allows users to select data context.

    ChooseDataContextPage

    If necessary, you can allow users to choose a custom assembly that contains a data context. To do this, enable the EFWizardSettings.ShowBrowseButton flag to add the Browse button to this page. Then, handle the EFDataSource.BeforeLoadCustomAssemblyGlobal event to manage custom assembly loading.

See Also