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

Problems with editing custom recurring appointments

Thread ID:

Created:

Updated:

Platform:

Replies:

141902 Jan 10,2019 12:28 AM UTC Jan 11,2019 01:12 PM UTC WPF 1
loading
Tags: SfSchedule
Tomislav Tustonic
Asked On January 10, 2019 12:28 AM UTC

Hello
Editing custom recurring appointments doesn't seem to work.

For example, I changed the CustomizationDemo to have one of the appointments recurring, like this:

var xdate = DateTime.Today.AddDays(-3) ;
            RecurrenceProperties RecProp = new RecurrenceProperties();
            RecProp.RecurrenceType = RecurrenceType.Daily;
            RecProp.IsDailyEveryNDays = true;
            RecProp.DailyNDays = 1;
            RecProp.IsRangeRecurrenceCount = true;
            RecProp.IsRangeNoEndDate = false;
            RecProp.IsRangeEndDate = false;
            RecProp.RangeRecurrenceCount = 15;
            var recRule = ScheduleHelper.RRuleGenerator(RecProp, xdate, xdate.AddDays(13));
            AppCollection.Add(new Appointment()
            {
                AppointmentImageURI = new BitmapImage(new Uri("pack://application:,,,/CustomizationDemo;Component/Assets/Team.png")),
                AppointmentType = Appointment.AppointmentTypes.Office,
                Status = Schedule.AppointmentStatusCollection[0],
                StartTime = xdate.AddHours(10),
                EndTime = xdate.AddHours(12),
                AppointmentTime = xdate.AddHours(10).ToString("hh:mm tt"),
                Subject = "TESTMeeting",
                AppointmentBackground = new SolidColorBrush(Color.FromArgb(255, 60, 181, 75)),
                RecurrenceRule = recRule,
                IsRecursive  = true
            }
            );

1. problem
When I run the demo, it correctly shows custom appointments. However, when I edit recurring appointment, click 'The entire series', change the Subject and save, the Schedule control still shows the old Subject (in this case 'TESTMeeting'). How to show updated properties in the SfSchedule when using custom appointment type?

2. problem
When I click on an recurring appointment, and click on 'Just this one' the program breaks in EditAppointment (which is called from the editButton_Click event handler) method with NullReferenceException, because the property AddDataContext.Appointment is not the custom Appointment type, but ScheduleAppointment. How to receive correct object type in this event handler (this problem also occurs in AppointmentEditorClosed event handler)?

Thanks, Tom

Arun siva [Syncfusion]
Replied On January 11, 2019 01:12 PM UTC

Hi Tomislav Tustonic, 
 
Thanks for contacting Syncfusion support, 
 
Query 1: Recurrence appointment collection doesn’t update based on the property changed in appointment editor 
In the customization sample, we have created a custom appointment editor for edit and update the appointments, in case of handling recurrence appointments, you need to handle the same in sample level to modify all the appointments based on the appointment editor. 
 
Query 2: How to get the custom appointment in the event handler 
 You can get the custom appointment of schedule in the event handler in sample level by using ObjectID property of appointment, there is a workaround for this, we have prepared a simple sample for the same.  
 
C# 
private object GetCustomAppointment(object originalSource) 
        { 
            var selectedAppointment = (originalSource as FrameworkElement).DataContext as ScheduleAppointment; 
            var recurringAppointment = schedule.Appointments.FirstOrDefault(appointment => appointment.IsRecursive && appointment.RecurrenceID == selectedAppointment.RecurrenceID); 
 
            var source = (IEnumerable<object>)schedule.ItemsSource; 
            if (recurringAppointment != null) 
                return source.FirstOrDefault(x => x.GetHashCode() == (int)recurringAppointment.ObjectID); 
 
            return null; 
        } 
 
Sample: Schedule 
 
Kindly revert us if you have any concern. 
 
Regards, 
Arun Siva R 


CONFIRMATION

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

This page will automatically be redirected to the 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

;