PrintingSystemBase.EditingFieldChanged Event
Occurs each time a value of an editing field changes.
Namespace: DevExpress.XtraPrinting
Assembly: DevExpress.Printing.v21.1.Core.dll
NuGet Package: DevExpress.Printing.Core
Declaration
Event Data
The EditingFieldChanged event's data class is EditingFieldEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
EditingField | Gets an editing field whose value has been changed. |
Remarks
Use the following properties to access an editing field’s value:
Each time the current field value changes, the EditingFieldChanged event occurs, allowing you to respond to this action (for instance, validate input data or format the edited value). The code snippet below demonstrates how to apply the same currency format to an unbound and data-aware control.
using DevExpress.XtraPrinting;
// ...
private void XtraReport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) {
PrintingSystem.EditingFieldChanged += PrintingSystem_EditingFieldChanged;
}
void PrintingSystem_EditingFieldChanged(object sender, EditingFieldEventArgs e) {
if (e.EditingField.Brick.TextValue != null) {
e.EditingField.Brick.TextValueFormatString = "{0:c2}";
e.EditingField.Brick.Text = string.Format(e.EditingField.Brick.TextValueFormatString, e.EditingField.Brick.TextValue);
}
else {
e.EditingField.Brick.Text = string.Format("{0:c2}", System.Convert.ToDouble(e.EditingField.Brick.Text));
}
}
For more information, see Content Editing in Print Preview.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the EditingFieldChanged 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.