Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to hide certain columns in the Timeline view (implement a custom scale)

$
0
0

Problem:

I'd like to hide columns for certain (non-working) hours in the TimelineView. How can I accomplish this?

Solution:

You can implement a custom time scale. It enables you to hide unneeded time periods.
A custom time scale class is inherited from the TimeScale class, overriding methods for the DateTime data handling and formatting.
You should override the following properties and methods:
SortingWeight - used to compare time scales;
Floor - specifies column boundaries;
HasNextDate - checks whether the move to the next date is allowed;
GetNextDate - navigates to the next date;
DefaultDisplayFormat - specifies the format for the column header caption;
DefaultMenuCaption - specifies the caption for the context menu item which enables this time scale;
FormatCaption - returns a string to be displayed as a column header caption.

To ensure a proper alignment of an upper (Day) scale, create a descendant with the Floor method overridden. Add this descendant to the scales collection in place of the default TimeScaleDay scale.

Question Comments

Added By: Lars Wuckel HHK at: 5/22/2015 7:20:57 AM    

There is an painting and end-time-calculation issue.

paint issue
If I create an all-day appointment the appointment will be painted that it would start at the last hour of the day before.

calc issue
If I create an appointment at the last hour of the day the end-time is the first hour of the next day.

Added By: Oleg (DevExpress Support) at: 5/22/2015 7:58:39 AM    

Hello Lars,
To process your recent post more efficiently, I created a separate ticket on your behalf: T245859: Issues with rendering and calculating appointment properties when a custom time scale is used. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


Viewing all articles
Browse latest Browse all 7205

Trending Articles