Skip to main content
A newer version of this page is available. .

Providing Custom Editors for Report Parameters

This document demonstrates how to customize an editor used to modify a report parameter value in the ASP.NET Document Viewer.

Tip

The Document Viewer displays default value editors according to report parameter types (Parameter.Type property values).

For this example to work properly, a report displayed in the Document Viewer should contain the categoryID parameter of the integer type. The Viewer automatically creates the standard ASPxSpinEdit editor for specifying this parameter’s values.

You can change the minimum and maximum values of this editor by handling the ASPxDocumentViewer.CustomizeParameterEditors event. In the event handler, check the CustomizeParameterEditorsEventArgs.Parameter property to identify the required parameter and customize the parameter editor using the CustomizeParameterEditorsEventArgs.Editor property.

protected void ASPxDocumentViewer1_CustomizeParameterEditors(object sender, DevExpress.XtraReports.Web.CustomizeParameterEditorsEventArgs e)
{
    if (e.Parameter.Name == "categoryID")
    {
        var spinEdit = e.Editor as ASPxSpinEdit;
        if (spinEdit == null)
            return;
        spinEdit.MinValue = 1;
        spinEdit.MaxValue = 8;
    }
}

The following image demonstrates the result:

ReportParams_CustomEditorsResult