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

Events

You can handle the following events when using the RadTimeBar for a very rich user experience with the control:

  • GroupIntervalChanged—Fires when interval groups drill level has changed.
  • HoveredPeriodChanged—Fires when the time period hovered changes.
  • ItemIntervalChanged—Fires when the interval items drill level has changed.
  • VisiblePeriodChanged—Fires when the period that is currently visible has changed as we scroll and zoom within the control.
  • SelectionChanged—Fires when the time period selection has changed.
  • ActualSelectionChanged—Fires when the selected time period is changing, i.e., when the user is dragging one of the selection thumbs. The ActualSelectionStart and ActualSelectionEnd properties will hold the selected period at this point.

For example you can get the current item interval using the ItemIntervalChanged event via the CurrentItemInterval property. This event will also fire on initial load, when the best current item interval is set.

Using the ItemIntervalChanged event to change the selection range when the CurrentItemInterval is the MonthInterval

private void TimeBar_ItemIntervalChanged(object sender, DrillEventArgs e) 
{ 
    RadTimeBar radTimeBar = (RadTimeBar)sender; 
 
    if (radTimeBar.CurrentItemInterval is MonthInterval) 
    { 
        radTimeBar.SelectionStart = new DateTime(2023, 05, 1); 
        radTimeBar.SelectionEnd = new DateTime(2023, 07, 1); 
    } 
} 
The same approach is applicable for groups - In order to get the current group interval you can use GroupIntervalChanged event and CurrentGroupInterval property respectively.

See Also

In this article
Not finding the help you need?