Problem with SelectedDate on RadTimePicker

5 posts, 1 answers
  1. Curt
    Curt avatar
    44 posts
    Member since:
    Oct 2007

    Posted 19 May 2008 Link to this post

    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.
  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 19 May 2008 Link to this post

    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
  3. Curt
    Curt avatar
    44 posts
    Member since:
    Oct 2007

    Posted 20 May 2008 Link to this post

    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.
  4. Answer
    Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 20 May 2008 Link to this post

    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
  5. Curt
    Curt avatar
    44 posts
    Member since:
    Oct 2007

    Posted 21 May 2008 Link to this post

    Thanks, thats worked great!
Back to Top