RadTimePicker TimeView incorrect after setting StartTime and EndTime

3 posts, 0 answers
  1. Jackie
    Jackie avatar
    16 posts
    Member since:
    Jan 2016

    Posted 13 Jun Link to this post

    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. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1402 posts

    Posted 14 Jun Link to this post

    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.
  3. Jackie
    Jackie avatar
    16 posts
    Member since:
    Jan 2016

    Posted 14 Jun in reply to Martin Ivanov Link to this post

    My mistake, will do.
Back to Top