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

How can i get the start and end time of clicked appointment

1 Answer 68 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Suraj asked on 05 Nov 2013, 01:55 PM
Hi I am very new to Scheduler control can anyone tell me how do i get start and end time  and also date  when i select the  the time say 4 pm in the code behind and then wheni save and when i try to retrieve it i am getting different time  this is how i am doing can any one tell me what is the problem
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    <div class="exampleContainer">
        <telerik:RadScheduler runat="server" ID="RadScheduler1" Width="750px" DayStartTime="08:00:00"
            DayEndTime="18:00:00" TimeZoneOffset="03:00:00" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
            OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentDelete="RadScheduler1_AppointmentDelete"
            DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End"
            DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId"
            DataReminderField="Reminder" DayView-ReadOnly="False">
            <AdvancedForm Modal="true"></AdvancedForm>
            <TimelineView UserSelectable="false"></TimelineView>
            <TimeSlotContextMenuSettings EnableDefault="true"></TimeSlotContextMenuSettings>
            <AppointmentContextMenuSettings EnableDefault="true"></AppointmentContextMenuSettings>
            <Reminders Enabled="true"></Reminders>

protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
            Appointments.Add(new AppointmentInfo(e.Appointment));
            DateTime start = e.Appointment.Start;
            DateTime end = e.Appointment.Start.AddMinutes(((RadScheduler)sender).MinutesPerRow);
            string startdate = e.Appointment.Start.ToString();

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 07 Nov 2013, 12:36 PM
Hello Suraj,

To get the start and end time of the appointment that you are inserting you can use the OnAppointmentInsert and the AppointmentUpdate server side events and the code below (you can also check the attached image file that demonstrates the properties that you can use)
protected void RadScheduler1_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
        var start= e.Appointment.Start.Date;
        var end = e.Appointment.End.TimeOfDay;

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 the blog feed now.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question