I have had to implement recurrence on the control because WinForms and WebForms are still unable to work with the same database entries.
In doing so, when recurrence is selected, I only allow daily and create physical entries in the booking table for each appointment. The child appointments point back to the parent but the recurrence rule on the parent stays blank.
All of this works fine (mostly). This allows for editing series or occurrence entries. It does however break the moment that an occurrence that does not appear on the same web page as the master entry is edited. The problem occurs on server side when you select Series on an edit of an existing entry:
container.Appointment returns Nothing. If you choose instance when editing, it works fine. If you have the master appointment on the screen at the time of selecting series, it also works fine.
Any idea why that would be the case and how I can work around it? If there is no suitable solution I will be removing the control from our project as it has created huge controversy around the rendering times, browser compatibility and WinForms integration issues.
Thank you for your time, paying for it was great fun.
6 Answers, 1 is accepted
Could you please clarify that you are facing this problem with the RadScheduler for ASP.NET AJAX or for WinForms?
I would like to clarify that by default the RadScheduler for ASP.NET AJAX loads all appointments (except for the web service binding) in the RadScheduler1.Appointments collection. As far as I understand from the provided information you are implementing your own logic for occurrence appointment edit and you are facing difficulties in finding the master appointment for specific occurrence appointments in order to modify the recurrence rule.
An easy and convenient way of finding the master appointment for an occurring appointment is shown in the code snippet below:
Asp.net. If I use the code you have provided, it would crash on line 1 because the e.appointment is null. This is the problem I am facing.
Which event are you using the code in? I am using it on the advanced edit form to populate the form
As far as I understand you want to modify the master appointment recurrence rule when you try to edit an occurrence appointment. So I have used the AppointmentUpdate server-side event. If you want to use the FormCreated which is fired when user opens the insert or edit forms you have to check whether e.Appointment.RecurrenceParentID is not null and then implement the logic for finding the master appointment.
at Chronos.BookingRequestAdvancedFormAdvancedForm.get_Owner() in C:\Source\Chronos\Chronos\Controls\AdvancedForm.ascx.vb:line 43
at Chronos.BookingRequestAdvancedFormAdvancedForm.InitializeStrings() in C:\Source\Chronos\Chronos\Controls\AdvancedForm.ascx.vb:line 345
at Chronos.BookingRequestAdvancedFormAdvancedForm.Page_Load(Object sender, EventArgs e) in C:\Source\Chronos\Chronos\Controls\AdvancedForm.ascx.vb:line 261
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.AddedControl(Control control, Int32 index)
at System.Web.UI.ControlCollection.Add(Control child)
at System.Web.UI.Control.AddParsedSubObject(Object obj)
at System.Web.UI.Control.System.Web.UI.IParserAccessor.AddParsedSubObject(Object obj)
at ASP.forms_bookingoverview_aspx.__BuildControl__control12(Control __ctrl) in C:\Source\Chronos\Chronos\Forms\BookingOverview.aspx:line 80
at System.Web.UI.CompiledBindableTemplateBuilder.InstantiateIn(Control container)
at Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Please refer to our code library help resource that shows how you use the advanced form as a complete separate user control. It does provide a template projects for server-side and web service binding in both C# and VB.