Skip to main content

ReportDesignerClientSideEventsBuilder.CustomizeParameterLookUpSource(String) Method

Sets the name of the JavaScript function or the entire code that will handle the Web Report Designer‘s CustomizeParameterLookUpSource client-side event.

Namespace: DevExpress.AspNetCore.Reporting.ReportDesigner

Assembly: DevExpress.AspNetCore.Reporting.v24.1.dll

NuGet Package: DevExpress.AspNetCore.Reporting

Declaration

public ReportDesignerClientSideEventsBuilder CustomizeParameterLookUpSource(
    string callback
)

Parameters

Name Type Description
callback String

The name of a JavaScript function or the entire JavaScript function code used to handle the CustomizeParameterLookUpSource event.

Returns

Type Description
ReportDesignerClientSideEventsBuilder

A ReportDesignerClientSideEventsBuilder that can be used to further configure the Report Designer Client Side Events.

Remarks

The CustomizeParameterLookUpSource event occurs each time a look-up editor is created for a report parameter. When implementing a handling function, use the objects passed as parameters. The first parameter passes the event sender that is the ClientReportDesigner object. The second one is an object with the following structure.

  • parameter
    An object that stores information about a parameter.

  • items
    A collection of look-up parameter values.

  • dataSource
    The data source that provides look-up values for the parameter editor.

The following example demonstrates how to sort look-up values of the categoryName parameter based on a custom rule. Declare an array that has category names in a sequence based on the required criterion. Then, check the parameter field of the object passed as the event’s second parameter to identify the required parameter. Access look-up values using the items field and sort them using a custom sorting function, which compares indexes of categories in the array. Finally, pass the result to the dataSource property to apply changes.

@{
    var designer = Html.DevExpress().ReportDesigner("reportDesigner1").Height("1000px")
        .Bind(Model.Report)
        .DataSources(configureDS => { foreach (var ds in Model.DataSources) { configureDS.Add(ds.Key, ds.Value); } })
        .ClientSideEvents(configure => { configure.CustomizeParameterLookUpSource("customizeParameterLookUpSource"); });
}
@designer
See Also