Properties

When setting up the RadTimeBar you should keep in mind that the Start Time properties should always be set before the End Time ones. Example 1 shows the required precedence of the properties.

Example 1: RadTimeBar Properties Precedence

<telerik:RadTimeBar x:Name="timeBar" Width="950" Height="250"       
                    PeriodStart="01-01-2011" 
                    PeriodEnd="01/01/2012" 
                    VisiblePeriodStart="01/01/2011" 
                    VisiblePeriodEnd="06/01/2011" 
                    SelectionStart="02/01/2011" 
                    SelectionEnd="03/01/2011" 
                    MinSelectionRange="28.00:00:00"                             
                    MaxSelectionRange="31.00:00:00"                             
                    IsSnapToIntervalEnabled="True" > 
    <telerik:RadTimeBar.Intervals> 
        <telerik:MonthInterval /> 
    </telerik:RadTimeBar.Intervals> 
</telerik:RadTimeBar> 

Key Properties

  • PeriodStart: Gets or sets the timebar's start date.
  • PeriodEnd: Gets or sets the timebar's end date.
  • VisiblePeriodStart: Gets or sets the currently visible start date.
  • VisiblePeriodEnd: Gets or sets the currently visible end date.
  • Intervals: Determines the displayed time intervals. The supported intevals are: Century, Decade, Year, Quarter, Month, Week, Day, Hour, Minute, Second, Millisecond.

Example 2: Setting the RadTimeBar Intervals

<telerik:RadTimeBar.Intervals> 
     <telerik:YearInterval /> 
     <telerik:MonthInterval/> 
     <telerik:WeekInterval/> 
     <telerik:DayInterval/> 
 </telerik:RadTimeBar.Intervals> 

Every interval has a preset collection of formatting strings that creates the string representation of a given date to match the interval. RadTimeBar automatically chooses the appropriate string formatter according to the control size and visible range. Learn more about that in the Intervals Formatters article.

  • SelectionStart and SelectionEnd: These properties determine the beginning of the selected range in the TimeBar control.

  • ActualSelectionStart and ActualSelectionEnd: When the user is dragging one of the selection thumbs, the SelectionStart and SelectionEnd properties are updated once the user releases the selection thumb. On the other hand, the ActualSelectionStart and ActualSelectionEnd properties are updated while the selection thumbs are moving.

  • IsSnapToIntervalEnabled: This turns on the snapping functionality, which will restrict the moving of the selection thumb, so that it will snap to the items' lines.

  • MinSelectionRange and MaxSelectionRange: These properties define the selection range interval. You won't be able to select an interval lower than the MinSelectionRange and higher than MaxSelectionRange.

  • IntervalSpans: This property can be set from each Interval except Decade and Quarter. It is used to group the given interval items together. Example 3 shows how you can group the seconds in groups of 10. Example 4 demonstrates that you can also set more than one IntervalSpan simultaneously by separating them with comma.

Example 3: Setting the IntervalSpans

<telerik:RadTimeBar.Intervals> 
   <telerik:SecondInterval IntervalSpans="10"/> 
</telerik:RadTimeBar.Intervals> 

Example 4: Setting multiple IntervalSpans

<telerik:RadTimeBar.Intervals> 
   <telerik:SecondInterval IntervalSpans="10,15,30" /> 
   <telerik:MinuteInterval IntervalSpans="1,10,15,30" /> 
</telerik:RadTimeBar.Intervals> 
  • CurrentItemInterval and CurrentGroupInterval: These properties can be used in code-behind to take the current item respectively group interval span set.

  • MinZoomRange and MaxZoomRange: These properties set the minimum and maximum range that the TimeBar can be zoomed.

The MinZoomRange cannot be set to

See Also

In this article