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

[Solved] Problem with SelectedDate on RadTimePicker

4 Answers 178 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 19 May 2008, 02:10 PM
Sorry if this is the incorrect forum board to post this topic, but I couldn't find a more relevant section.

I'm having an issue when specifying the SelectedDate attribute of the RadTimePicker. For some reason no matter when value I specify the displayed value is "12:00 AM". Why is this and how can I fix this?

Thanks for your help,

Curt.

4 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 19 May 2008, 02:31 PM
Hello Curt,

Could you please elaborate a bit on your scenario? What version of the controls are you using? I am testing this with the latest official release of RadControls for Asp.Net Ajax but cannot observe any problem. If you can paste some of your markup here, or tell us how to reproduce it, we will be grateful.

Best wishes,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Curt
Top achievements
Rank 1
answered on 20 May 2008, 09:32 AM
Thanks, Heres my source:

Dim TimeArranged As DateTime = 'Fetches datetime from database
date1.selecteddate = TimeArranged
time1.SelectedDate = TimeArranged.ToString("hh:mm")

date1 is a datepicker, time1 is a timepicker.

Thanks again,
Curt.
0
Accepted
Pavel
Telerik team
answered on 20 May 2008, 01:24 PM
Hello Curt,

You cannot set the SelectedDate property of the TimePicker to a string. Please try setting the property like this: time1.SelectedDate = TimeArranged. The control should ignore the date part and will take only the time. Additionally if you want to format the way the time is displayed, you should use the DateFormat property of the DateInput part of the picker like this: RadTimePicker1.DateInput.DateFormat = "hh:mm". See the following help article for reference on how to format dates with the DateFormat property.

Hope this helps.

Kind regards,
Pavel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Curt
Top achievements
Rank 1
answered on 21 May 2008, 08:38 AM
Thanks, thats worked great!
Tags
Calendar
Asked by
Curt
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Curt
Top achievements
Rank 1
Share this question
or