Articles in this section
Category / Section

How to customize the timescale labels appearance?

1 min read


This article describes how to customize the timescale labels appearance.



This requirement can be achieved by setting the LabelTemplate property in timescale tier.


The following code sample illustrates the label template usage along with alignment customization.


    <DataTemplate x:Key="TopTierLabelTemplate">
        <Border BorderBrush="Blue" BorderThickness="2" Background="SkyBlue">
            <TextBlock Text="{Binding Content}" Foreground="Red"
                   TextAlignment="{Binding LabelAlignment}" FontSize="25"/>
<gantt:SfGantt ItemsSource="{Binding TaskCollection}">
                <gantt:TimescaleTier LabelTemplate="{StaticResource TopTierLabelTemplate}"/>



this.Gantt.TimescaleSettings.TopTier.LabelTemplate = this.MainGrid.Resources["TopTierLabelTemplate"] as DataTemplate;


The following screenshot is the output of the above code.



Please find the required sample from the link.

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied