How to change the time ranges on the DatePicker of the Advanced Form?

3 posts, 1 answers
  1. Scott Hodson
    Scott Hodson avatar
    5 posts
    Member since:
    Apr 2005

    Posted 27 Jul 2011 Link to this post

    When I bring up the advanced edit/insert form the times range from 8am to 5pm, but my scheduler control's WorkDayStartTime and WorkDayEndTime as set to 5am and 7pm.  How do I get the advanced form to use the same time ranges as my WorkDay time range?
  2. Scott Hodson
    Scott Hodson avatar
    5 posts
    Member since:
    Apr 2005

    Posted 28 Jul 2011 Link to this post

    Any ideas?  Is this a bug in the RadScheduler?
  3. Answer
    Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 29 Jul 2011 Link to this post

    Hello Scott Hodson,

    You can handle FormCreated event like this:
    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e){
        if ((e.Container.Mode == SchedulerFormMode.AdvancedEdit) || (e.Container.Mode == SchedulerFormMode.AdvancedInsert)) {
            RadTimePicker startTime = e.Container.FindControl("StartTime") as RadTimePicker;
            startTime.TimeView.StartTime = new TimeSpan(5, 0, 0);
            startTime.TimeView.Interval = new TimeSpan(0, 15, 0);
            startTime.TimeView.EndTime = new TimeSpan(19, 0, 0);
            startTime.TimeView.Columns = 4;
            startTime.TimeView.DataList.DataSource = null;
            startTime.DataBind();
        }

    Hope this is helpful.

    Best wishes,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top