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

RadTimePicker TimeView incorrect after setting StartTime and EndTime

2 Answers 95 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Jackie
Top achievements
Rank 1
Jackie asked on 13 Jun 2017, 07:11 PM

A pair of RadTimePickers I have for selecting the beginning and end of a shift are displaying the timeview incorrectly after being enabled and having the starttime and endtime values set. They both show every slot from 12AM to 11:45PM, but starting with 12AM selecting a slot displays the value that SHOULD be seen, 8:30AM in this case, and continues for each subsequent slot in the same manner until the endtime slot, whose correct value is 5:15PM at the 8:45AM slot on the selection view. When the binding event is called a second time, the timeviews for both RTPs are correctly shown, going from 8:30AM to 5:15PM. HTML markup of the RTPs in question as follows, as well as the code-behind for the binding event.

//HTML//
<telerik:RadTimePicker ID="tpStartTime" runat="server" EnableTyping="false" TimeView-Columns="4" TimeView-Interval="00:15:00" Enabled="false"></telerik:RadTimePicker>
<telerik:RadTimePicker ID="tpEndTime" runat="server" EnableTyping="false" TimeView-Columns="4" TimeView-Interval="00:15:00" Enabled="false"></telerik:RadTimePicker>
 
//C#//
protected void dpOriginalDate_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
    {
        DateTime[] shift = getShift((DateTime)dpOriginalDate.SelectedDate);
        tpStartTime.Enabled = tpEndTime.Enabled = true;
        tpStartTime.TimeView.StartTime = shift[0].TimeOfDay;
        tpStartTime.TimeView.EndTime = shift[1].TimeOfDay;
        tpEndTime.TimeView.StartTime = shift[0].AddMinutes(15).TimeOfDay;
        tpEndTime.TimeView.EndTime = shift[1].AddMinutes(15).TimeOfDay;
    }

Page_Load contains Page.DataBind(); which appears to be the cause. Do I have to do without it or is there a workaround?

 

 

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 14 Jun 2017, 07:30 AM
Hello Jackie,

This is the WPF forum. May I ask you to post your question in the ASP.NET AJAX forum.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Jackie
Top achievements
Rank 1
answered on 14 Jun 2017, 12:31 PM
My mistake, will do.
Tags
TimePicker
Asked by
Jackie
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Jackie
Top achievements
Rank 1
Share this question
or