Selection

RadTimeSpanPicker control enables the app users to quickly and easily select a time interval. This topic explaines the TimeSpanPicker API related to time interval selection.

Time Property

  • Time(TimeSpan?): Defines the current selection of time interval. The default value is null.

Example

<telerikInput:RadTimeSpanPicker Time="5:10:30:00"/>

And the namespace used:

xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.Maui.Controls.Compatibility"

Methods

Cancel the selected time using the ClearSelection method.

Example

<StackLayout>
    <Button Text="Clear Selection" Clicked="OnClearSelectionClicked"/>
    <telerikInput:RadTimeSpanPicker x:Name="timeSpanPicker"/>
</StackLayout>

And the namespace used:

xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.Maui.Controls.Compatibility"

Call ClearSelection inside the button click event - as a result Time property will be updated to null.

private void OnClearSelectionClicked(object sender, EventArgs e)
{
    this.timeSpanPicker.ClearSelection();
}

Events

  • SelectionChanged event which is raised when the user picks a time value.

Example

<telerikInput:RadTimeSpanPicker SelectionChanged="RadTimeSpanPicker_SelectionChanged"/>

And the namespace used:

xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.Maui.Controls.Compatibility"

and the SelectionChanged event, where the sender is the RadTimeSpanPicker control

private void RadTimeSpanPicker_SelectionChanged(object sender, EventArgs e)
{
    // implement your logic here
}

See Also

In this article
Not finding the help you need?