Version

ColumnHeaderAppearance Property (UltraTimelineView)

Gets/sets the appearance for the headers which represent the PrimaryInterval and the members of the AdditionalIntervals collection.
Syntax
'Declaration
 
Public Property ColumnHeaderAppearance As Infragistics.Win.AppearanceBase
public Infragistics.Win.AppearanceBase ColumnHeaderAppearance {get; set;}
Remarks

A HeaderAppearance is exposed by the DateTimeInterval class, so that a different appearance can be set for each interval displayed by the control. All headers displayed by that interval, however, share this appearance.

The event arguments used for the ColumnHeaderInitializing event provide a way to customize the appearance for individual headers, via the AppearanceData property of the event arguments. This structure exposes properties, such as BackColor and ForeColor, which are applied to the header for which the event was fired. Note that it is recommended that use of this approach be as conservative as possible since the number of headers generated during the lifetime of the application can be large. In cases where multiple headers share the same appearance, it is recommended that one instance of this structure be shared amongst them, to reduce the memory footprint. It is also recommended that an images that are assigned in this manner are disposed of appropriately.

Example
The following code sample demonstrates how to use the properties of the UltraTimelineView control to customize the column headers.

Imports System.Collections.Generic
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.Diagnostics

    Public Sub InitColumnProps(ByVal control As UltraTimelineView)

        '  Set ColumnAutoSizing to 'AllVisibleIntervals' so that when the user auto-sizes
        '  the columns, the width required to show the additional interval's captions is considered
        control.ColumnAutoSizing = TimelineViewColumnAutoSizing.AllVisibleIntervals

        '  Use the ColumnHeaderAppearance to customize the look for all headers
        control.ColumnHeaderAppearance.BackColor = Color.White
        control.ColumnHeaderAppearance.BackColor2 = Color.LightBlue
        control.ColumnHeaderAppearance.BorderColor = Color.DarkBlue
        control.ColumnHeaderAppearance.ForeColor = Color.DarkBlue

        '  Don't show images on the headers
        control.ColumnHeaderImageVisible = False

        '  Only display the minutes for the primary interval, if there is
        '  an additional interval being displayed for the hours.
        Dim hasHourInterval As Boolean = False
        For Each dti As DateTimeInterval In control.VisibleIntervals

            Dim timeInterval As TimeInterval = IIf(dti.GetType() Is GetType(TimeInterval), dti, Nothing)
            If Not timeInterval Is Nothing AndAlso timeInterval.IntervalUnits = TimeIntervalUnits.Hours Then
                hasHourInterval = True
            End If
        next

        control.PrimaryInterval.HeaderTextFormat = IIf(hasHourInterval, "mm", Nothing)

        '  Orient the text for the primary interval on a diagonal
        control.PrimaryInterval.HeaderTextOrientation = New TextOrientationInfo(45, TextFlowDirection.Horizontal)

        '  Set the ideal width for the column headers
        control.PerformColumnAutoResize(TimelineViewColumnAutoSizing.AllVisibleIntervals)
    End Sub
using System.Collections.Generic;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.Diagnostics;

    public void InitColumnProps( UltraTimelineView control )
    {
        //  Set ColumnAutoSizing to 'AllVisibleIntervals' so that when the user auto-sizes
        //  the columns, the width required to show the additional interval's captions is considered
        control.ColumnAutoSizing = TimelineViewColumnAutoSizing.AllVisibleIntervals;

        //  Use the ColumnHeaderAppearance to customize the look for all headers
        control.ColumnHeaderAppearance.BackColor = Color.White;
        control.ColumnHeaderAppearance.BackColor2 = Color.LightBlue;
        control.ColumnHeaderAppearance.BorderColor = Color.DarkBlue;
        control.ColumnHeaderAppearance.ForeColor = Color.DarkBlue;

        //  Don't show images on the headers
        control.ColumnHeaderImageVisible = false;

        //  Only display the minutes for the primary interval, if there is
        //  an additional interval being displayed for the hours.
        bool hasHourInterval = false;
        foreach( DateTimeInterval dti in control.VisibleIntervals )
        {
            TimeInterval timeInterval = dti as TimeInterval;
            if ( timeInterval != null && timeInterval.IntervalUnits == TimeIntervalUnits.Hours )
                hasHourInterval = true;
        }

        control.PrimaryInterval.HeaderTextFormat = hasHourInterval ? "mm" : null;

        //  Orient the text for the primary interval on a diagonal
        control.PrimaryInterval.HeaderTextOrientation = new TextOrientationInfo(45, TextFlowDirection.Horizontal);

        //  Set the ideal width for the column headers
        control.PerformColumnAutoResize( TimelineViewColumnAutoSizing.AllVisibleIntervals );
    }
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also