TextInfoControlBase.CustomizeText Event
Occurs before the control is rendered, and enables you to modify the text being printed.
Namespace: DevExpress.XtraScheduler.Reporting
Assembly: DevExpress.XtraScheduler.v24.2.Reporting.dll
Declaration
Event Data
The CustomizeText event's data class is TextCustomizingEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Text | Gets or sets the text printed by the control. |
Remarks
The CustomizeText event, in addition to the XRControl.BeforePrint event (which is inherited from the XtraReport control) provides the ability to modify the control’s content before it is printed. Event arguments for different controls are inherited from the TextCustomizingEventArgs base class, to implement properties specific to a particular control.
The following code sample handles the TextInfoControlBase.CustomizeText
event for the TimeIntervalInfo control, to print the weekday name in French in the second text line of the control.
using DevExpress.XtraScheduler;
using DevExpress.XtraReports.UI;
using DevExpress.XtraScheduler.Reporting;
// ...
private void timeIntervalInfo1_CustomizeText(object sender,
DevExpress.XtraScheduler.Reporting.TextCustomizingEventArgs e) {
TimeIntervalTextCustomizingEventArgs args = (TimeIntervalTextCustomizingEventArgs)e;
args.SecondLineText = args.Interval.Start.ToString("dddd",
System.Globalization.CultureInfo.CreateSpecificCulture("fr-FR"));
}
The following code snippet handles the TextInfoControlBase.CustomizeText
event of the ResourceInfo control, to print the resource captions with their IDs.
using DevExpress.XtraScheduler;
using DevExpress.XtraReports.UI;
using DevExpress.XtraScheduler.Reporting;
// ...
private void resourceInfo1_CustomizeText(object sender, TextCustomizingEventArgs e) {
ResourceTextCustomizingEventArgs args = (ResourceTextCustomizingEventArgs)e;
string text = "";
foreach(Resource res in args.Resources)
text = text + res.Caption + " (id = " + res.Id + ") ";
args.Text = text;
}