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

ReportDataSourceHelperBase.CustomSetSorting Event

Occurs when sorting is applied to the report data source.

Namespace: DevExpress.ExpressApp.ReportsV2.Services

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

Declaration

public event EventHandler<CustomSetSortingEventArgs> CustomSetSorting

Event Data

The CustomSetSorting event's data class is DevExpress.ExpressApp.ReportsV2.CustomSetSortingEventArgs.

Remarks

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

In Application Builder Code

In the application’s Startup.cs file, add the OnCustomSetSorting 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.OnCustomSetSorting = 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 CustomSetSorting event.

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

Implements

See Also