Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > TimePicker > Programmatically set the SelectedTime

Not answered Programmatically set the SelectedTime

Feed from this thread
  • Posted on Dec 15, 2010 (permalink)

    Hello,

    I have C# application that uses the RadDatePicker and the RadTimePicker. Here is the XAML I will be referencing:
    <telerik:RadDatePicker x:Name="myDatePicker" DateTimeWatermarkContent="MM/DD/YY" />
    <telerik:RadTimePicker x:Name="myTimePicker" DateTimeWatermarkContent="HH:MM:SS" StartTime="0:0:0" EndTime="23:0:0" Culture="en-US" />

    I need to programmatically set the selected TIME of "myTimePicker". In an attempt to do this, I am using the following:
    myDatePicker.SelectedDate = MyDateTimeProp.Date;
    myTimePicker.SelectedTime = MyDateTimeProp.TimeOfDay;

    Oddly, the correct date appears in the RadDatePicker, but the time is not displayed in the RadTimePicker. How do I programmatically set the time displayed in the RadTimePicker? 

    Thank you

    Reply

  • Kaloyan Kaloyan admin's avatar

    Posted on Dec 17, 2010 (permalink)

    Hello Frustrated Dev,

    I have created a test demo project with the code posted by you and it appears that the control is working properly. The RadTimePickers updates the SelectedTime when a new value is assigned to it. Can you check if the following code is working on your side:  myTimePicker.SelectedTime = DateTime.Now.TimeOfDay


    Kind regards,
    Kaloyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > TimePicker > Programmatically set the SelectedTime
Related resources for "Programmatically set the SelectedTime"

Silverlight TimePicker Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]