Back to Devexpress

DashboardConfigurator.CustomParameters Event

dashboard-devexpress-dot-dashboardweb-dot-dashboardconfigurator-15d5da23.md

latest5.6 KB
Original Source

DashboardConfigurator.CustomParameters Event

Occurs before data is loaded from the data store and allows you to customize dashboard parameters that are used for data processing.

Namespace : DevExpress.DashboardWeb

Assembly : DevExpress.Dashboard.v25.2.Web.dll

NuGet Package : DevExpress.Web.Dashboard.Common

Declaration

csharp
public event CustomParametersWebEventHandler CustomParameters
vb
Public Event CustomParameters As CustomParametersWebEventHandler

Event Data

The CustomParameters event's data class is CustomParametersWebEventArgs. The following properties provide information specific to this event:

PropertyDescription
DashboardIdGets the identifier of the required dashboard.
ParametersGets or sets dashboard parameters. Inherited from CustomParametersEventArgs.

Remarks

The CustomParameters event allows you to access a collection of dashboard parameters (e.Parameters) and change actual parameter values, parameter settings, or even add new parameters.

To set parameter values at runtime, use the dashboard state.

Security Consideration

Parameter values specified in the CustomParameters event handler are set before executing a data query. They are not displayed in the Dashboard Parameters dialog. However, if the IncludeHiddenParameters client property is enabled (for example, DashboardExcelExportOptions.IncludeHiddenParameters), a user can still get access to all hidden parameters with their values.

Encode the passed parameter value if possible. Do not store any sensitive information in dashboard parameters that isn’t encrypted.

The following code snippets (auto-collected from DevExpress Examples) contain references to the CustomParameters event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

asp-net-core-dashboard-refresh-item-on-parameter-change/CS/AspNetCoreDashboard/Code/DashboardUtils.cs#L20

csharp
configurator.CustomParameters += (s, e) => {
    var value = Convert.ToInt32(contextAccessor?.HttpContext?.Request.Headers["ProductId"].FirstOrDefault());

asp-net-core-dashboard-pass-hidden-parameters-to-custom-sql-query/CS/AspNetCoreDashboard_CustomParameters/Code/DashboardUtils.cs#L26

csharp
configurator.CustomParameters += (s, e) => {
    var countryParam = e.Parameters.FirstOrDefault(p => p.Name == "CountryDashboardParameter");

aspnet-core-dashboard-use-different-caches/CS/AspNetCoreDashboardUseDifferentCaches/Startup.cs#L56

csharp
// Specifies a unique cache parameter.
configurator.CustomParameters += (sender, e) => {
    e.Parameters.Add(new DashboardParameter("UniqueCacheParam", typeof(Guid), serviceProvider.GetService<CacheManager>().UniqueCacheParam));

mvc-dashboard-use-different-caches/VB/MvcDashboardUseDifferentCaches/App_Start/DashboardConfig.vb#L31

vb
AddHandler DashboardConfigurator.Default.CustomParameters, AddressOf Default_CustomParameters
End Sub

See Also

Server-Side API Overview

DashboardConfigurator Class

DashboardConfigurator Members

DevExpress.DashboardWeb Namespace