Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Collapse]Scheduler
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Collapse]Examples
    [Expand]Appearance
    [Expand]Data Binding
    [Expand]Data Exchange
    [Expand]DateTime
    [Expand]DateNavigator
    [Expand]Forms
    [Expand]Gantt View
    [Expand]Initialization
    [Expand]Labels and Statuses
    [Collapse]Layout
      How to: Programmatically Change the Active View
      How to: Group Appointments by Resources or Dates
      How to: Save and Restore a Layout
      How to: Hide Certain Columns in the Timeline View
    [Expand]Menu
    [Expand]Printing and Reporting
    [Expand]Protection
    [Expand]Range Control
    [Expand]Recurrence
    [Expand]Reminders
    [Expand]Selection
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Hide Certain Columns in the Timeline View

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E531.

This example illustrates how to hide columns for certain (non-working) hours in the Timeline View.

To accomplish this task, 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 used for date and time handling and formatting.

The following properties and methods can be overridden to create a custom time scale:

  • SortingWeight - used to compare time scales;
  • TimeScale.Floor - specifies column boundaries;
  • HasNextDate - checks whether moving 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;
  • TimeScale.FormatCaption - returns a string to be displayed as a column header caption.

To ensure proper alignment of an upper (Day) scale, create a descendant of the TimeScaleDay class that overrides the TimeScaleDay.Floor method. Add this descendant to the TimelineView.Scales collection in place of the default TimeScaleDay scale.

The resulting Timeline View is demonstrated in the following picture.

Note

Actually, non-working hours are not hidden. They are packed within the last time cell of each day because the time line has to be continuous.

How would you rate this topic?​​​​​​​