This is a migrated thread and some comments may be shown as answers.

RTP as timespan selector

5 Answers 134 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 27 Jul 2012, 06:05 AM
Am I aiming for the wrong thing to think I can use the RadTimePicker to select a Timepsan?

I need get rid of the AM PM and also stop it from thinking/displaying 00:00:00 as 12:00PM?

ohhh and what exactly am i binding to? SelectedTime={binding TimeSpan}?

thanks in advance

Michael

5 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 30 Jul 2012, 02:28 AM
just a kick

telerik are usually so helpful in these matters
0
Ivo
Telerik team
answered on 01 Aug 2012, 11:26 AM
Hi Michael,

In order to achieve this using the RadTimePicker you will have to set its Culture property. Also you will have to use the SelectedTime property to get the TimeSpan value of the RadTimePicker. Here is sample code: 
public MainWindow()
{
    InitializeComponent();
    var culture = new CultureInfo("en-US");
    culture.DateTimeFormat.ShortTimePattern = "HH:mm";
    this.RadTimePicker.Culture = culture;
}


All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Michael
Top achievements
Rank 1
answered on 01 Aug 2012, 03:40 PM
thanks for the reply.

The timepicker in my solution is within a DataFormDataField??

So it cant be addressed like this.RadTimePicker?
0
Ivo
Telerik team
answered on 03 Aug 2012, 01:58 PM
Hi Michael,

If you don't have any other controls using the ShortTimePattern into your DataForm I would suggest you to change its Culture property. Otherwise you will have to iterate through the VisualTree to find the RadTimePicker control and set its culture.

Regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Michael
Top achievements
Rank 1
answered on 03 Aug 2012, 02:02 PM
Nice thanks...I created a property on the viewmodel and bound the culture to that
Tags
TimePicker
Asked by
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Ivo
Telerik team
Share this question
or