UserDesignerOptions.DateTimeComponentBindingMode Property
Specifies how report controls extract date-time components from bound field values.
Namespace: DevExpress.XtraReports.Configuration
Assembly: DevExpress.XtraReports.v25.1.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
Property Value
Type | Description |
---|---|
FieldListDateTimeComponentBindingMode | A FieldListDateTimeComponentBindingMode value that indicates whether to use a format string or expression. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to DateTimeComponentBindingMode |
---|---|
ReportingSettings |
|
Settings |
|
Remarks
If you need to display a date-time value component, you no longer need to specify a format string or use expression functions. The Field List window now allows you to expand date-time fields and see available components. You can drag and drop these components onto existing controls to establish new data bindings or place them on the report surface to create new data-bound controls.
Set the ShowFieldListDateTimeComponents property to true
, so the Field List displays date-time components for DateTime, DateOnly, and TimeOnly fields:
- DateOnly
- Day, Month, Year
- DateTime
- Day, Month, Year, Hour, Minute, Second
- TimeOnly
- Hour, Minute, Second
You can do it at application startup or in the Visual Studio Report Designer settings window.
This functionality supports two modes. Use the DateTimeComponentBindingMode
property to switch between modes. When a field is dropped from the Field List, the Report Designer automatically creates an expression binding and does one of the following:
- Format String
Example:
{0:%d}
,{0:%M}
Applies a format string to field values according to the selected date-time component. This mode is useful for displaying formatted date or time values in a report.
- Expression
Example:
GetDay
,GetMonth
Assigns an expression function when you add a field component from the Field List or use a field component in the Expression Editor. You can further refine expressions in the Expression Editor. This mode is most useful when you need to combine data from multiple data source fields.
See the class description for information on how to set designer options in code: UserDesignerOptions.