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

Key Properties

This help article will provide information about the StringFormat property, a key property of the RadTimeSpanPicker control.

StringFormat

You can use the StringFormat property for formatting the representation of the selected TimeSpan value to any desired format. By using it the current format of the TimeSpan could easily be changed.

The following example demonstrates how to set the StringFormat property.

Example 1: Setting the StringFormat of the RadTimeSpanPicker

<telerik:RadTimeSpanPicker StringFormat="d' Days, 'h' hours and 'mm' minutes'"> 
    <telerik:RadTimeSpanPicker.TimeSpanComponents> 
        <telerik:DayTimeSpanComponent/> 
        <telerik:HourTimeSpanComponent/> 
        <telerik:MinuteTimeSpanComponent/> 
    </telerik:RadTimeSpanPicker.TimeSpanComponents> 
</telerik:RadTimeSpanPicker> 

Figure 1: The new StringFormat representation of the TimeSpan

WPF RadTimeSpanPicker The new StringFormat representation of the TimeSpan

You can find detailed inforamation about the supported formats of the TimeSpan here.

See Also

In this article