Skip to main content
All docs
V24.2
.NET 8.0+

ReportDataSourceHelperBase.CustomSetCriteria Event

Occurs when criteria are applied to the report data source.

Namespace: DevExpress.ExpressApp.ReportsV2.Services

Assembly: DevExpress.ExpressApp.ReportsV2.v24.2.dll

Declaration

public event EventHandler<CustomSetCriteriaEventArgs> CustomSetCriteria

Event Data

The CustomSetCriteria event's data class is DevExpress.ExpressApp.ReportsV2.CustomSetCriteriaEventArgs.

Remarks

Handle this event to apply criteria in a custom manner. The following code snippets demonstrate how to subscribe to this event:

In Application Builder Code

In the application’s Startup.cs file, add the OnCustomSetCriteria event handler to the builder.Modules.AddReports method call as shown below:

File: MySolution.Blazor.Server/Startup.cs, MySolution.Win/Startup.cs, MySolution.WebApi/Startup.cs

using DevExpress.ExpressApp.ApplicationBuilder;
// ...
builder.Modules
    .AddReports(options => {
        // ...
        options.Events.OnCustomSetCriteria = context => {
            // ...
        };
    })
// ...

Through Dependency Injection

Note

The technique shown in this section is not supported for Web API Service.

Use Dependency Injection to access the IReportDataSourceHelper service and add a handler to its CustomSetCriteria event.

using DevExpress.ExpressApp.ReportsV2;
using Microsoft.Extensions.DependencyInjection;
// ...
// Use Dependency Injection to access the IServiceProvider.
var helper = serviceProvider.GetRequiredService<IReportDataSourceHelper>();
helper.CustomSetCriteria += delegate (object sender, CustomSetCriteriaEventArgs e) {
    // ...
};

Implements

See Also