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. Image for the cookie policy date

SfSchedule Don't refresh after update an appoinment that already exists V.15.3.0.29

When update an appoinment that already exists neither the color, subject or programming was updated this 
also didnt work with any custom object using MVVM pattern.

The Refresh method don't exists for SfSchedule in Xamarin.Forms V.15.3.0.29




XAML
<syncfusion:SfSchedule x:Name="schedule" ScheduleView="MonthView" ShowAppointmentsInline="True" >
<Button Text="Update" Clicked="Button_Update" />


//Instance variable
// Creating an instance for schedule appointment collection
ObservableCollection<ScheduleAppointment> scheduleAppointmentCollection = new ObservableCollection<ScheduleAppointment>();


...
In constructor of class
after call InitializeComponent();

//Adding schedule appointment in schedule appointment collection var scheduleAppointment = new ScheduleAppointment() { StartTime = new DateTime(2017, 05, 08, 10, 0, 0), EndTime = new DateTime(2017, 05, 08, 12, 0, 0), Subject = "Occurs every alternate day", IsRecursive = true }; //Adding schedule appointment in schedule appointment collection scheduleAppointmentCollection.Add(scheduleAppointment); //Adding schedule appointment collection to DataSource of SfSchedule schedule.DataSource=scheduleAppointmentCollection; // Creating recurrence rule RecurrenceProperties recurrenceProperties = new RecurrenceProperties(); recurrenceProperties.RecurrenceType = RecurrenceType.Daily; recurrenceProperties.IsRangeRecurrenceCount = true; recurrenceProperties.DailyNDays = 2; recurrenceProperties.IsDailyEveryNDays = true; recurrenceProperties.IsWeeklySunday = false; recurrenceProperties.IsWeeklyMonday = true; recurrenceProperties.IsWeeklyTuesday = false; recurrenceProperties.IsWeeklyWednesday = false; recurrenceProperties.IsWeeklyThursday = false; recurrenceProperties.IsWeeklyFriday = false; recurrenceProperties.IsWeeklySaturday = false; recurrenceProperties.RangeRecurrenceCount = 10; recurrenceProperties.RecurrenceRule = DependencyService.Get<IRecurrenceBuilder>().RRuleGenerator(recurrenceProperties, scheduleAppointment.StartTime, scheduleAppointment.EndTime); // Setting recurrence rule to schedule appointment scheduleAppointment.RecurrenceRule = recurrenceProperties.RecurrenceRule;

....
...


//IN CLICK EVENT

private void Button_Update(object sender, EventArgs e)
{

var scheduleAppointment =scheduleAppointmentCollection[0];


RecurrenceProperties recurrenceProperties = new RecurrenceProperties(); recurrenceProperties.RecurrenceType = RecurrenceType.Daily; recurrenceProperties.IsRangeRecurrenceCount = true; recurrenceProperties.DailyNDays = 2; recurrenceProperties.IsDailyEveryNDays = true; recurrenceProperties.IsWeeklySunday = false; recurrenceProperties.IsWeeklyMonday = true; recurrenceProperties.IsWeeklyTuesday = false; recurrenceProperties.IsWeeklyWednesday = false; recurrenceProperties.IsWeeklyThursday = false; recurrenceProperties.IsWeeklyFriday = false; recurrenceProperties.IsWeeklySaturday = false; recurrenceProperties.RangeRecurrenceCount = 40; // HERE IS THE NEW VALUE recurrenceProperties.RecurrenceRule = DependencyService.Get<IRecurrenceBuilder>().RRuleGenerator(recurrenceProperties, scheduleAppointment.StartTime, scheduleAppointment.EndTime); // Setting recurrence rule to schedule appointment scheduleAppointment.RecurrenceRule = recurrenceProperties.RecurrenceRule;

        scheduleAppointment.Subject="I Expect the change";
}

1 Reply

NM Nijamudeen Mohamed Sulaiman Syncfusion Team September 1, 2017 09:11 AM UTC

Hi alfredo,

 

Thanks for your interest in Syncfusion products.

We have analyzed the given example code and found that you are creating a new ScheduleAppointment object while updating through a button click. We have modified your example code and created a simple sample for the same. Please refer the sample below.

if the given solution does not meet your requirement, could you please provide us more details about your requirement along with XForms cross platform (Android, iOS or UWP), Device configuration etc. It will be helpful for us to analyze on your requirement and provide you the possible solution.

Regards,
Nijamudeen M.


Attachment: SfSchedule_Appointment_XForms_d61d5688.zip

Loader.
Live Chat Icon For mobile
Up arrow icon