We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

null reference exception when adding a seccond appointment in SfSchedule

Thread ID:





132107 Aug 14,2017 08:53 PM UTC Aug 18,2017 07:27 PM UTC WPF 1
Tags: SfSchedule
Asked On August 14, 2017 08:53 PM UTC

i want to add som reccurring appointments to an SfSchedule Control, it accept the dirst appointment that i put in it, but when i want to add a second one it gives me a null reference exception.

this is my code:

var appointment = ((Horarios.BindingClass) DataContext).Appointment as ScheduleAppointment ??
                              new ScheduleAppointment();

            RecurrenceProperties RecProp = new RecurrenceProperties
                RecurrenceType = RecurrenceType.Weekly,
                IsRangeRecurrenceCount = false,
                IsRangeNoEndDate = true,
                IsRangeEndDate = false,


            switch (((Horarios.BindingClass)DataContext).CurrentSelectedDate.Value.DayOfWeek)
                case DayOfWeek.Sunday:
                case DayOfWeek.Monday:
                    RecProp.IsWeeklyMonday = true;
                case DayOfWeek.Tuesday:
                    RecProp.IsWeeklyTuesday = true;
                case DayOfWeek.Wednesday:
                    RecProp.IsWeeklyWednesday = true;
                case DayOfWeek.Thursday:
                    RecProp.IsWeeklyThursday = true;
                case DayOfWeek.Friday:
                    RecProp.IsWeeklyFriday = true;
                case DayOfWeek.Saturday:

                    RecProp.IsWeeklySaturday = true;
                    throw new ArgumentOutOfRangeException();

            appointment.StartTime = StartTime.DateTime.Value;
            appointment.EndTime = EndTime.DateTime.Value;
            appointment.RecurrenceRule = ScheduleHelper.RRuleGenerator(RecProp,
            appointment.StartTime, appointment.EndTime);
            appointment.IsRecursive = false;

i always get  a null reference exception on the last line when i'm addin a second appointment, does not matter if it is a recurrent appointment or not.

Sivakumar Punniya Moorthi [Syncfusion]
Replied On August 18, 2017 07:27 PM UTC

Hi Jesus, 

Thanks for using Syncfusion products. 

We had prepared a sample with the provided code snippet. Can you please provide as the following information?  So that we could provide you the prompt solution. 
1.      Version of SfSchedule.WPF.dll 
2.      .Net framework used. 
3.      Screen shot or stack trace of the Exception occurred. 

Sample Link :  ScheduleApp

Sivakumar P 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon