Hello,
I am doing all my data handling in the code behind. If I create a daily recurring appointment the parent RecurrenceRule gets updated correctly and I end up with, for example: DTSTART:20110606T073000Z\n\rDTEND:20110606T083000Z\n\rRRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR\n\rEXDATE:20110609T073000Z
I can edit everything about the series except removing the the exceptions.
I notice that in the examples resetting exceptions reflects immediately in the UI, before clicking save. For me, this does not happen. It says Working... Then it says Done.. But the deleted day does not return. And when I click Save, in the code behind, the AppointmentUpdate event, e.ModifiedAppointment.RecurrenceRule shows the exceptions I was trying to remove.
Is there an event server or client side that I need to be handling?
Here is my aspx and codebehind:
I am doing all my data handling in the code behind. If I create a daily recurring appointment the parent RecurrenceRule gets updated correctly and I end up with, for example: DTSTART:20110606T073000Z\n\rDTEND:20110606T083000Z\n\rRRULE:FREQ=DAILY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR\n\rEXDATE:20110609T073000Z
I can edit everything about the series except removing the the exceptions.
I notice that in the examples resetting exceptions reflects immediately in the UI, before clicking save. For me, this does not happen. It says Working... Then it says Done.. But the deleted day does not return. And when I click Save, in the code behind, the AppointmentUpdate event, e.ModifiedAppointment.RecurrenceRule shows the exceptions I was trying to remove.
Is there an event server or client side that I need to be handling?
Here is my aspx and codebehind:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="CRMScheduler.ascx.vb" Inherits="CRM_TestClient.CRMScheduler" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="rad" %>
<
rad:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
rad:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
rad:AjaxUpdatedControl
ControlID
=
"RadAjaxManager1"
/>
</
UpdatedControls
>
</
rad:AjaxSetting
>
<
rad:AjaxSetting
AjaxControlID
=
"RadAjaxManager1"
>
<
UpdatedControls
>
<
rad:AjaxUpdatedControl
ControlID
=
"Scheduler"
/>
</
UpdatedControls
>
</
rad:AjaxSetting
>
<
rad:AjaxSetting
AjaxControlID
=
"Scheduler"
>
<
UpdatedControls
>
<
rad:AjaxUpdatedControl
ControlID
=
"Scheduler"
/>
</
UpdatedControls
>
</
rad:AjaxSetting
>
</
AjaxSettings
>
</
rad:RadAjaxManager
>
<
rad:RadScheduler
runat
=
"server"
ID
=
"Scheduler"
Width
=
"753px"
Height
=
"600px"
Skin
=
"Vista"
EnableExactTimeRendering
=
"true"
StartEditingInAdvancedForm
=
"true"
StartInsertingInAdvancedForm
=
"true"
DataKeyField
=
"Schedule_id"
DataStartField
=
"Start"
DataEndField
=
"End"
DataSubjectField
=
"Subject"
DataDescriptionField
=
"Description"
DataRecurrenceField
=
"RecurrenceRule"
DataReminderField
=
"Reminder"
DataRecurrenceParentKeyField
=
"RecurrenceParentSchedule_id"
AppointmentContextMenuSettings-EnableDefault
=
"false"
TimeSlotContextMenuSettings-EnableDefault
=
"false"
TimelineView-UserSelectable
=
"false"
>
<
AdvancedForm
Modal
=
"true"
/>
</
rad:RadScheduler
>
Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Public Class CRMScheduler
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
' 2011-06-03 10:00:00
Scheduler.SelectedDate = Now()
Scheduler.SelectedView = SchedulerViewType.WeekView
Scheduler.DayStartTime = New TimeSpan(7, 0, 0)
Scheduler.DayEndTime = New TimeSpan(20, 0, 0)
Scheduler.WorkDayStartTime = New TimeSpan(8, 0, 0)
Scheduler.WorkDayEndTime = New TimeSpan(18, 0, 0)
Scheduler.FirstDayOfWeek = DayOfWeek.Monday
Scheduler.LastDayOfWeek = DayOfWeek.Saturday
BindSchedule()
End If
End Sub
Private Sub BindSchedule()
Dim ds As List(Of objCRM.Schedule) = objCRM.Schedule.SelectScheduleByDealer(Session("Dealer_id"))
For i As Int32 = 0 To ds.Count - 1
If ds(i).RecurrenceRule = "" Then
ds(i).RecurrenceRule = Nothing
End If
Next
Scheduler.DataSource = ds
Scheduler.DataBind()
End Sub
Private Sub Scheduler_AppointmentDataBound(sender As Object, e As Telerik.Web.UI.SchedulerEventArgs) Handles Scheduler.AppointmentDataBound
Dim RecurrenceRule As String = e.Appointment.RecurrenceRule
If e.Appointment.RecurrenceParentID = -1 Then
e.Appointment.RecurrenceParentID = Nothing
End If
End Sub
Private Sub Scheduler_AppointmentDelete(sender As Object, e As Telerik.Web.UI.AppointmentDeleteEventArgs) Handles Scheduler.AppointmentDelete
objCRM.Schedule.DeleteSchedule(e.Appointment.ID)
BindSchedule()
End Sub
Private Sub Scheduler_AppointmentInsert(sender As Object, e As Telerik.Web.UI.AppointmentInsertEventArgs) Handles Scheduler.AppointmentInsert
Dim User_id As Int32 = -1
Dim Subject As String = e.Appointment.Subject
Dim Description As String = e.Appointment.Description
Dim Start As String = e.Appointment.Start.ToString
Dim [End] As String = e.Appointment.End.ToString
Dim RecurrenceRule As String = e.Appointment.RecurrenceRule.ToString
Dim RecurrenceParentSchedule_id As String = IIf(e.Appointment.RecurrenceParentID Is Nothing, -1, CInt(e.Appointment.RecurrenceParentID))
Dim Reminder As String = e.Appointment.Reminders.ToString
Dim s As objCRM.Schedule = New objCRM.Schedule(Session("Dealer_id"), User_id, Subject, Description, Start, [End], RecurrenceRule, RecurrenceParentSchedule_id, Reminder)
BindSchedule()
End Sub
Private Sub Scheduler_AppointmentUpdate(sender As Object, e As Telerik.Web.UI.AppointmentUpdateEventArgs) Handles Scheduler.AppointmentUpdate
Dim s As objCRM.Schedule = New objCRM.Schedule(e.Appointment.ID)
' Dim User_id As Int32 = -1
s.Subject = e.ModifiedAppointment.Subject
s.Description = e.ModifiedAppointment.Description
s.Start = e.ModifiedAppointment.Start.ToString
s.[End] = e.ModifiedAppointment.End.ToString
s.RecurrenceRule = e.ModifiedAppointment.RecurrenceRule.ToString
s.RecurrenceParentSchedule_id = IIf(e.ModifiedAppointment.RecurrenceParentID Is Nothing, -1, CInt(e.ModifiedAppointment.RecurrenceParentID))
s.Reminder = e.ModifiedAppointment.Reminders.ToString
s.Update()
BindSchedule()
End Sub
Private Sub Scheduler_NavigationCommand(sender As Object, e As Telerik.Web.UI.SchedulerNavigationCommandEventArgs) Handles Scheduler.NavigationCommand
BindSchedule()
End Sub
End Class