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

Setting defaults on Add New

1 Answer 73 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
MikeK
Top achievements
Rank 1
MikeK asked on 14 Feb 2008, 03:44 PM
We've setup a Dental Scheduling application using the Prometheus scheduler, it works great!

One item that we need to change -

When a user double-clicks a date on the calendar, we open the appointment in detail mode so all of our required fields are displayed and captured. The default dates are as All Day, with a timespan of the current date until the next.

We need the default timespan set to have All Day unchecked, and the date range to be the same date. How do we do this?

The next thing that would be really nice would be to be able to set the time ranges. Example:  the user is double clicking a day for a given client, it would automatically select a half hour range for the first available time, based on a stored procedure to determine this. If we could push a start and end time into the create appointment event, I could do the rest. Not a necessity, but nice. I need to figure out how to remove the All Day check as a priority. No dental appointment is all day.

Thanks, and great control!!

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 15 Feb 2008, 02:20 PM
Hello Michael,

You can try the following solution:

 protected void RadScheduler1_FormCreating(object sender, Telerik.Web.UI.SchedulerFormCreatingEventArgs e)  
    {  
        RadScheduler scheduler1 = (RadScheduler)sender;  
 
        if ((scheduler1.SelectedView == SchedulerViewType.MonthView)&(e.Mode == SchedulerFormMode.Insert))  
        {                 
                e.Appointment.Start = e.Appointment.Start.Add(new TimeSpan(8, 0, 0));  
                e.Appointment.End = e.Appointment.Start.Add(new TimeSpan(1, 0, 0));  
        }  
    } 

For your second question, this can be accomplished with the following methods available in the Appointment class:

      RadScheduler1.Appointments.GetAppointmentsEnclosingRange( start, end);  
        RadScheduler1.Appointments.GetAppointmentsInRange(start, end);  
        RadScheduler1.Appointments.GetAppointmentsStartingInRange(star, end); 



Is this what you need? Please, feel free to contact us if you have further questions or if you need more help with this case.



Best wishes,
Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
MikeK
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or