Edit this page

Getting Started

This topic will walk you through the creating of RadTimeSpanPicker.

In order to use RadTimeSpanPicker in your project you have to add references to the following two assemblies:

  • Telerik.Windows.Controls.dll
  • Telerik.Windows.Controls.Input.dll

You can include the control in your page by either dragging it from the toolbox in Visual Studio, or manually creating the control. Below is an example of how to create RadTimeSpanPicker in XAML

[XAML] Creating RadTimeSpanPicker

<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadTimeSpanPicker GenerateDefaultComponents="True"/>
    </Grid>
</UserControl>

You can also create RadTimeSpanPicker in code-behind:

[C#] Creating RadTimeSpanPicker in code

RadTimeSpanPicker timeSpanPicker = new RadTimeSpanPicker();
timeSpanPicker.GenerateDefaultComponents = true;

[VB] Creating RadTimeSpanPicker in code

Dim timeSpanPicker As New RadTimeSpanPicker()
timeSpanPicker.GenerateDefaultComponents = True

By setting the GenerateDefaultComponents property to True the control will use the default components for hours, minutes and seconds. If you need to visualize some of the other built-in components or a custom component of your own you could add them as shown below to the TimeSpanComponents collection:

[XAML] Adding TimeSpanComponents

<UserControl xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <Grid x:Name="LayoutRoot1" Background="White">
        <telerik:RadTimeSpanPicker>
            <telerik:RadTimeSpanPicker.TimeSpanComponents>
                <telerik:DayTimeSpanComponent/>
                <telerik:HourTimeSpanComponent/>
                <telerik:MinuteTimeSpanComponent/>
                <telerik:SecondTimeSpanComponent/>
                <telerik:MillisecondTimeSpanComponent/>
            </telerik:RadTimeSpanPicker.TimeSpanComponents>
        </telerik:RadTimeSpanPicker>
    </Grid>
</UserControl>

See Also