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

RadTimePIcker.SelectedTime compiler error

2 Answers 56 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 22 Mar 2013, 08:14 PM
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 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 23 Apr 2013, 01:46 AM
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?
0
Pavlina
Telerik team
answered on 23 Apr 2013, 04:04 PM
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:
http://www.telerik.com/products/aspnet-ajax/whats-new/release-history/q1-2013-version-2013-1-220.aspx
(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,
Pavlina
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.
Tags
Calendar
Asked by
Scott
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or