New to Telerik UI for WPF? Download free 30-day trial

Change the periods' strip line background

This help topic will demonstrate how to change the background of the strip lines displayed behind the RadTimeline control’s periods. RadTimeline - How to change the strip lines background 1

The lines are represented by TimelineStripLineControl which exposes couple of Style properties that can be used for changing its background. They accept a Style targeting a native Border element that is used for drawing the strip lines.

  • NormalStyle - this style is applied on each odd strip line occurrence
  • AlternateStyle - this style is applied on each even strip line occurrence

You can use an implicit Style to set the style on the TimelineStripLineControls. The following example demonstrates this approach:

<telerik:RadTimeline PeriodStart="2015-2-24"  
        <telerik:YearInterval /> 
        <telerik:QuarterInterval /> 
        <telerik:MonthInterval /> 
        <telerik:WeekInterval /> 
        <telerik:DayInterval /> 

    <Style TargetType="Border" x:Key="normalStyle"> 
        <Setter Property="Background" Value="#F67E4B" /> 
    <Style TargetType="Border" x:Key="alternateStyle"> 
        <Setter Property="Background" Value="#FCE4C2" /> 
    <Style TargetType="telerik:TimelineStripLineControl"> 
        <Setter Property="NormalStyle" Value="{StaticResource normalStyle}" /> 
        <Setter Property="AlternateStyle" Value="{StaticResource alternateStyle}" /> 

The RadTimeline control doesn't expose a property that sets/gets the Style for the TimelineStripLineControls and this is why we define the style implicitly in the resources.

RadTimeline - How to change the strip lines background 2

See Also

In this article