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

Full day in clock items

4 Answers 79 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Jakkie Esschert van den
Top achievements
Rank 1
Jakkie Esschert van den asked on 10 Oct 2011, 12:22 PM
Hi,

I'm using a DateTimePicker in TimePicker mode to select a duration. I've set my own clockitems to provide a set of predefined durations, which work fine. However, I'd like to provide a 24:00 hour clock item as well which I can't get to work. When I set the EndTime to 24:00 a timespan of 24 hours does get added to the clock items, however it is displayed as 0:00 and when selected a 0:00 timespan is returned.

Is there a way around this? I can work around the fact that 24:00 gets converted to 0:00, but I can't find a way to make the drop down display 24:00 for the largest item.

4 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 11 Oct 2011, 02:37 PM
Hi Jakkie,

You can affect the format of the displayed time or date in the RadDateTimePicker only through setting the Culture. You can find more information about the CultureInfo class here.

Hope this information helps.

Kind regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Jakkie Esschert van den
Top achievements
Rank 1
answered on 11 Oct 2011, 03:09 PM
The thing is that I can't use the culture because it can't be configured to display a TimeSpan of one day as 24:00. But even if I could, a one day TimeSpan becomes a zero timespan internally in the DateTimePicker.
I realize I'm trying to stretch the possibilities of the DateTimePicker here, as I'm not actually selecting a time but a Duration. However, when selecting a duration offering a 24 hour duration seems a reasonable use case to me. Perhaps there should be a DurationPicker...
0
Accepted
Konstantina
Telerik team
answered on 12 Oct 2011, 02:42 PM
Hi Jakkie,

You could try to implement the custom parsing. You can find more information about it in this help article.
Alternately, you could use the RadComboBox. It is much more flexible, you could set the ItemsSource to hours and you could customize it so that it looks more like the TimePicker. You can view its demos here.

Regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Jakkie Esschert van den
Top achievements
Rank 1
answered on 12 Oct 2011, 03:05 PM
I'll take a look at both options. Thanks for the help.
Tags
DateTimePicker
Asked by
Jakkie Esschert van den
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Jakkie Esschert van den
Top achievements
Rank 1
Share this question
or