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

Conversion API

RadTimeBar allows you to convert a screen coordinates (a Point), to a DateTime value plotted on the timebar control. You can do that via the ConvertPointToDateTime method of RadTimeBar. The method excepts an argument of type Windows.Foundation.Point and it returns a DateTime object.

The following example will show how to retrieve the DateTime that the mouse is currently over

Getting the DateTime under the mouse

public MainWindow() 
{ 
    this.InitializeComponent(); 
 
    Mouse.AddMouseDownHandler(this.timeBar, OnMouseDown); 
} 
 
private void OnMouseDown(object sender, MouseButtonEventArgs e) 
{ 
    RadTimeBar radTimeBar = (RadTimeBar)sender; 
    Windows.Foundation.Point mousePosition = e.GetPosition(radTimeBar); 
    DateTime date = this.timeBar.ConvertPointToDateTime(mousePosition); 
} 
In this article
Not finding the help you need?