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

RADScheduler Insert form start time interval--15 min

14 Answers 329 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Pavan padavala
Top achievements
Rank 1
Pavan padavala asked on 01 Feb 2010, 11:34 PM
Hi,

I am working on RadScheduler and we need 15 min interval in the starttime and end time when creating new Appointment.
by default it is 30 min.
1.) Is it possible to change this? If yes how?
2.) Also, I have a custom resources that can be selected in the drop down below. Is it possible to put a deafult resource when user enters this screen?

Pls see the attached file.

Thanks In Advance.

14 Answers, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 02 Feb 2010, 12:19 PM
Hello Pavan,

The code that follows will help you achieve both requirements:

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.Interval = new TimeSpan(0, 15, 0);
            startTime.TimeView.DataList.DataSource = null;
            startTime.DataBind();
  
            RadTimePicker endTime = e.Container.FindControl("EndTime") as RadTimePicker;
            endTime.TimeView.Interval = new TimeSpan(0, 15, 0);
            endTime.TimeView.DataList.DataSource = null;
            endTime.DataBind();
            if (e.Container.Mode == SchedulerFormMode.AdvancedInsert)
            {
                RadComboBox resCombo = (RadComboBox)e.Container.FindControl("ResRoom");
                resCombo.SelectedIndex = 1;
            }
        }
    }

'Room' is the name of the resource type added to RadScheduler. You need to modify the code with your actual resource name.


Best wishes,
Peter
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Pavan padavala
Top achievements
Rank 1
answered on 03 Feb 2010, 12:56 AM
Thanks alot Peter. It worked :)
0
Hai
Top achievements
Rank 1
answered on 17 Mar 2011, 04:55 PM
Hi,
I have a question about the Start time and Endtime in Insert/Edit mode. If I select StartTime to be 1 month after today, is there anyway to make the EndTime automatically change to 1 month after.
For example: by default as I edit an appointment:
- Start time: 3/17/2011, 9:30 AM.    End Time: 3/17/2011, 10:30 AM
As I change the Start time to 4/17/2011, time x, the End time should be automatically changed to 4/17/2011, x + 1 hour.

Kind regards,
Hai Tran
0
Peter
Telerik team
answered on 24 Mar 2011, 10:26 AM
Hello Hai,

Thank you for this question.

Here is one possible solution for this requirement:
<script type="text/javascript">
      function OnDateSelected(sender, args) {
          var endDatePickerId = document.getElementById("HiddenField1").value;
          var endDatePicker = $find(endDatePickerId);
          endDatePicker.set_selectedDate(args.get_newDate())
      }
  </script>
  <asp:HiddenField ID="HiddenField1" runat="server" />
  <telerik:RadScheduler runat="server" ID="RadScheduler1" OnFormCreated="RadScheduler1_FormCreated"
      StartEditingInAdvancedForm="true" StartInsertingInAdvancedForm="true">
  </telerik:RadScheduler>

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
   {
       if (e.Container.Mode == SchedulerFormMode.AdvancedEdit || e.Container.Mode == SchedulerFormMode.AdvancedInsert)
       {
           RadDatePicker startDate = e.Container.FindControl("StartDate") as RadDatePicker;
           startDate.ClientEvents.OnDateSelected = "OnDateSelected";
           RadDatePicker endDate = e.Container.FindControl("EndDate") as RadDatePicker;
           HiddenField1.Value = endDate.ClientID;
           
       }
   }



Best wishes,
Peter
the Telerik team
0
Hai
Top achievements
Rank 1
answered on 25 Mar 2011, 06:22 AM
Thank you so much for your solution. It works perfectly.
I found that when I changed the date on the top of my scheduler, the 2 calendars on the side did not change. They should be synchronized with the selected date of the scheduler. May you show me how to do it?

King regards,
Hai Tran 
0
Peter
Telerik team
answered on 29 Mar 2011, 09:35 AM
Hi Hai,

I don't quite understand what you mean. Can you elaborate and send us a screen capture to illustrate the requirement?


Kind regards,
Peter
the Telerik team
0
Marc
Top achievements
Rank 1
answered on 09 Aug 2011, 10:50 AM
Hi, 
I have to do the same thing, but in the Scheduler WeekView I was able to Change the time interval (See attachment), but is there any way to change the Time Format in the Side bar to show the minutes.
And have something like this :
8:00 am
8:30 am
9:00 am
9:30 am

Instead of :
8 am      
8 am
9 am
9 am

Thank you,

Marc
0
Peter
Telerik team
answered on 11 Aug 2011, 12:35 PM
Hi Marc,

Please, try the following RadScheduler settings -

HoursPanelTimeFormat="HH:mm tt"
MinutesPerRow="15"


Greetings,
Peter
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.

0
Marc
Top achievements
Rank 1
answered on 14 Aug 2011, 07:15 AM
Hi Peter,

That was it! Thank you!

Regards,

Marc
0
shahab
Top achievements
Rank 1
answered on 26 Apr 2013, 08:00 AM
I use your code but I got an error to set Interval from code:
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."

protected void PatientScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
protected void PatientScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        RadTimePicker startTime = (RadTimePicker)e.Container.FindControl("StartTime");
        RadTimePicker endTime = (RadTimePicker)e.Container.FindControl("EndTime");
        startTime.TimeView.Interval = endTime.TimeView.Interval = new TimeSpan(0, Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]), 0);     
        startTime.DataBind();
        endTime.DataBind();
}
0
shahab
Top achievements
Rank 1
answered on 26 Apr 2013, 08:01 AM
I use your code but I got an error to set Interval from code:
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."

protected void PatientScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
protected void PatientScheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        RadTimePicker startTime = (RadTimePicker)e.Container.FindControl("StartTime");
        RadTimePicker endTime = (RadTimePicker)e.Container.FindControl("EndTime");
        startTime.TimeView.Interval = endTime.TimeView.Interval = new TimeSpan(0, Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]), 0);     
        startTime.DataBind();
        endTime.DataBind();
}
0
Plamen
Telerik team
answered on 01 May 2013, 07:11 AM
Hello shahab,

 
Would you please elaborate what are you trying to achieve with the code posted because it is not quite clear from the explanation provided?

Kind regards,
Plamen
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.
0
shahab
Top achievements
Rank 1
answered on 01 May 2013, 09:45 AM
"Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control."

I got mentioned error when call    endTime.DataBind(); (It is your solution to the problem)
0
Plamen
Telerik team
answered on 06 May 2013, 08:43 AM
Hi shahab,

 
It looks like the Convert.ToInt32(ConfigurationManager.AppSettings["Interval"]) in your code is breaking this functionality. You can refer to this help topic where in the Change the start time picker options section is described how we recommend to achieve such customization.

Kind regards,
Plamen
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
Scheduler
Asked by
Pavan padavala
Top achievements
Rank 1
Answers by
Peter
Telerik team
Pavan padavala
Top achievements
Rank 1
Hai
Top achievements
Rank 1
Marc
Top achievements
Rank 1
shahab
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or