Skip to main content

TimeScaleBase.DisplayFormats Property

Gets or sets the collection of string formats displayed in the timeline caption.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v24.1.dll

NuGet Package: DevExpress.Wpf.Scheduling

Declaration

public IEnumerable<string> DisplayFormats { get; set; }

Property Value

Type Description
IEnumerable<String>

A IEnumerable<T><String,> object that is the collection of string values specifying caption’s format.

Remarks

You can specify a collection of format strings with different length. A suitable format string will be automatically selected depending on the timeline header width.

The following code snippet illustrates how to provide format strings for different header lengths in the WPF resource dictionary:

<Window.Resources>
    <x:Array
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        x:Key="TimelineWeekFormats"
        Type="{x:Type sys:String}">
        <sys:String>{0:ddd, dd-MM, yyyy} - {1:ddd, dd-MM, yyyy}</sys:String>
        <sys:String>{0:dd-MMM-yy} -> {1:dd-MMM-yy}</sys:String>
        <sys:String>{0:dd} - {1:dd}</sys:String>
    </x:Array>
</Window.Resources>
<!--...-->
  <dxsch:TimeScaleWeek
      DisplayFormats="{StaticResource TimelineWeekFormats}" />

The resulting TimelineView looks as follows:

Refer to the Custom date and time format strings article for information on formats.

See Also