Back to Devexpress

UserDesignerOptions.DateTimeComponentBindingMode Property

xtrareports-devexpress-dot-xtrareports-dot-configuration-dot-userdesigneroptions-acdc5903.md

latest4.4 KB
Original Source

UserDesignerOptions.DateTimeComponentBindingMode Property

Specifies how report controls extract date-time components from bound field values.

Namespace : DevExpress.XtraReports.Configuration

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public FieldListDateTimeComponentBindingMode DateTimeComponentBindingMode { get; set; }
vb
Public Property DateTimeComponentBindingMode As FieldListDateTimeComponentBindingMode

Property Value

TypeDescription
FieldListDateTimeComponentBindingMode

A FieldListDateTimeComponentBindingMode value that indicates whether to use a format string or expression.

|

Available values:

Name
FormatString
Expression

Property Paths

You can access this nested property as listed below:

Object TypePath to DateTimeComponentBindingMode
ReportingSettings

.UserDesignerOptions .DateTimeComponentBindingMode

| | Settings |

.UserDesignerOptions .DateTimeComponentBindingMode

|

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:

DateOnlyDay, Month, YearDateTimeDay, Month, Year, Hour, Minute, SecondTimeOnlyHour, 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.

See Also

UserDesignerOptions Class

UserDesignerOptions Members

DevExpress.XtraReports.Configuration Namespace