XtraReport.ParametersRequestValueChanged Event
Occurs when the parameter values are changed in the Parameters UI.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v18.1.dll
Declaration
public event EventHandler<ParametersRequestValueChangedEventArgs> ParametersRequestValueChanged
Event Data
The ParametersRequestValueChanged event's data class is ParametersRequestValueChangedEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
ChangedParameterInfo | Contains information about the parameter, which value was changed. |
ParametersInformation | Provides access to information about the requested parameters. Inherited from ParametersRequestEventArgs. |
Remarks
The ParametersRequestValueChanged event fires only for Windows Forms applications.
Example
This example demonstrates how to perform report parameter validation, and restore the previous parameter value if the validation fails (if the parameter value is greater than 10 or less than 0).
This is achieved by handling the report’s XtraReport.ParametersRequestSubmit and XtraReport.ParametersRequestValueChanged events.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-cancel-parameter-submitting-if-user-input-validation-fails-e2045.
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.Parameters;
// ...
namespace CancelSubmitParameters {
public partial class XtraReport1 : XtraReport {
int parameter;
public XtraReport1() {
InitializeComponent();
}
private void XtraReport1_ParametersRequestSubmit(object sender,
ParametersRequestEventArgs e) {
if ((int)e.ParametersInformation[0].Parameter.Value > 10 ||
(int)e.ParametersInformation[0].Parameter.Value < 0) {
e.ParametersInformation[0].Parameter.Value = parameter;
e.ParametersInformation[0].Editor.Text = parameter.ToString();
}
}
private void XtraReport1_ParametersRequestValueChanged(object sender,
ParametersRequestValueChangedEventArgs e) {
parameter = (int)e.ChangedParameterInfo.Parameter.Value;
}
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ParametersRequestValueChanged 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.