RadTimePIcker.SelectedTime compiler error

3 posts, 0 answers
  1. Scott
    Scott avatar
    35 posts
    Member since:
    Sep 2012

    Posted 22 Mar 2013 Link to this post

    I am using RadControls for ASP.NET AJAX, v.2012.2.912.40

    I am trying to set the Time on my RadTimePicker using the SelectedTime member in the C# code-behind, but I get the compiler error:  
            'Telerik.Web.UI.RadTimePicker' does not contain a definition for 'SelectedTime'

    I am able to set it using the SelectedDate property, so my code works, but the on-line documentation states that the SelectedTime member should work. http://www.telerik.com/help/aspnet-ajax/p_telerik_web_ui_radtimepicker_selectedtime.html

    Mostly I'm just curious why the compiler doesn't recognize the SelectedTime member.

    Here's the ascx code fragment:
    <telerik:RadDateInput ID="DateIN" runat="server"> </telerik:RadDateInput>
    <telerik:RadTimePicker ID="TimeIN" runat="server"> </telerik:RadTimePicker>

    Here's the C# code behind:
    DateTime? dateIN = DateTime.Now;
    TimeSpan? timeIN = dateIN.Value.TimeOfDay;
    DateIN.SelectedDate = dateIN;
    // this works
    TimeIN.SelectedDate = myData.DateIN.Value.Date.AddMinutes(myData.TimeIN.Value.Minutes);
    // this doesn't compile & it should
    TimeIN.SelectedTime = timeIN;

  2. Scott
    Scott avatar
    35 posts
    Member since:
    Sep 2012

    Posted 22 Apr 2013 Link to this post

    So it's been a month with no response on my question, so I'll try again.  Is there, or is there not a member SelectedTime for the RadTimePicker? Is the documentation just out of date?
  3. Pavlina
    Pavlina avatar
    6166 posts

    Posted 23 Apr 2013 Link to this post

    Hello Scott,

    The SelectedTime property for RadTimePicker is available since Q1 2013 version of RadControls. Therefore you received an error when you try to use it with an older version. This is also pointed in the Release notes:
    (Added: Functionality to the RadTimePicker to show only specific times in the time picker list)

    If you want to use the SelectedTime property you should upgrade to the latest version of the controls. I am also attaching a test project which handles this functionality.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top