Refresh scheduler after changing DataSource

Hello,
  I have a problem (with Android) with Scheduler update. I have placed a scheduler on a contentpage

                <schedule:SfSchedule x:Name="Schedule" ScheduleView="WeekView" Locale="it" TimeIntervalHeight="180"
                                     ShowResourceView="True" ResourceViewHeight="100" ShowAppointmentsInline="True"
                                     DataSource="{Binding ListOfMeeting}"
                                     ScheduleResources="{Binding Resources}"
                                     SelectedResources="{Binding SelectedResources}"
                                    VisibleDatesChangedEvent="Schedule_VisibleDatesChangedEvent"
                                     CellTapped="Schedule_CellTapped"
                                     VerticalOptions="FillAndExpand"
                                     HorizontalOptions="FillAndExpand">
                    <schedule:SfSchedule.AppointmentMapping>
                        <schedule:ScheduleAppointmentMapping
                        ColorMapping="Color"
                        EndTimeMapping="EndTime"
                        IsAllDayMapping="IsAllDay"
                        StartTimeMapping="BeginTime"
                        SubjectMapping="EventName"
                        MinHeightMapping="MinimumHeight"
                        ResourceIdsMapping="Resources"/>
                    </schedule:SfSchedule.AppointmentMapping>
                    <schedule:SfSchedule.ResourceMapping>
                        <schedule:ResourceMapping Name="Name"
                                            Id="ID"
                                            Color="Color"
                                            Image="Image"
                                              />
                    </schedule:SfSchedule.ResourceMapping>
                    <schedule:SfSchedule.ResourceViewSettings>
                        <schedule:ResourceViewSettings SelectionMode ="Multiple">
                        </schedule:ResourceViewSettings>
                    </schedule:SfSchedule.ResourceViewSettings>
                    <schedule:SfSchedule.TimelineViewSettings>
                        <schedule:TimelineViewSettings StartHour="8" EndHour="20"/>
                    </schedule:SfSchedule.TimelineViewSettings>
                    <schedule:SfSchedule.BindingContext>
                        <pages:EmptyPageViewModel />
                    </schedule:SfSchedule.BindingContext>
                </schedule:SfSchedule>

When I load the page all works fine, but I'm not able to change the DataSource collection. If I add or remove an item form the collection, nothing happends. For example  in CellTapped event I do:
        private async void Schedule_CellTapped(object sender, Syncfusion.SfSchedule.XForms.CellTappedEventArgs e)
        {
            try
            {
                this.MainActivityIndicator.IsVisible = true;
                this.MainActivityIndicator.IsRunning = true;

                Meeting meeting = e.Appointment as Meeting;
                this.selectedMeeting = meeting;
                if (meeting != null)
                {
                    EmptyPageViewModel viewModel = this.Schedule.BindingContext as EmptyPageViewModel;
                    viewModel.ListOfMeeting.Remove(this.selectedMeeting);
                }
            }
            finally
            {
                this.MainActivityIndicator.IsVisible = false;
                this.MainActivityIndicator.IsRunning = false;
            }
        }

The first time that I tap on cell meeting is not equals to null, the second time that I tap on cell meeting is null, but it still apparing on form. It's a refresh problem?

  Thanks,
      Davide Roncelli


6 Replies 1 reply marked as answer

MS Muniappan Subramanian Syncfusion Team November 16, 2020 10:08 AM UTC

Hi Davide Roncelli, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your requirement of using “How to add and remove appointments in schedule”. SfSchedule allows you to add and edit appointments based on the requirement by using CellTapped event in schedule. You can refer our following KB documentation to achieve your requirement. 
 
 
Kindly follow the instructions provided in the above KB document and let us know if you would require any further assistance. 
 
Regards, 
Muniappan S. 



DR Davide Roncelli November 16, 2020 02:46 PM UTC

Dear Muniappan,
   I have tested and integrated the example, but I don't solved the problem. After that I have removed the appointment from the collection with the instruction

                    (this.Schedule.DataSource as ObservableCollection<Meeting>).Remove(meeting);
inside the Schedule_CellTapped event, the collection is changed correctly, but the scheduler on form doesn't refresh. So I still view the event on form, but if I tap on appointment the property e.Appointment is null because the appointment isn't in the DataSource collection (but is visible on form).

So, I should do some explicit view refresh?

  Thanks,
   Davide Roncelli


SS SaiGanesh Sakthivel Syncfusion Team November 17, 2020 01:29 PM UTC

Hi Davide, 
 
Thank you for the patience. 
 
#Regarding Refresh scheduler after changing DataSource 
We would like to inform you that we have logged issue report for the same. We will fix the issue and include the issue fix in our upcoming 2020 Volume 4 release which is planned to roll out in the month of December, 2020. We appreciate your patience until then. 
 
  
Note: The provided feedback link is private, you need to login to view this feedback. 
 
Regards, 
SaiGanesh Sakthivel 



SS SaiGanesh Sakthivel Syncfusion Team December 17, 2020 02:20 PM UTC

Hi Davide, 
 
Thank you for your patience.   
 
We are glad to announce that our Essential Studio 2020 Volume 4 release v18.4.0.30  is rolled out and the issue fix “Refresh scheduler after changing DataSource” included in the release. 
 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards,            
SaiGanesh Sakthivel 


Marked as answer

DA Davi October 21, 2022 12:20 PM UTC

Hello,


I'm having the same problem, but when adding and removing items in BlackoutDate, could I have access to the example too?



Regards, 

Davi Bittencourt



MS Muniappan Subramanian Syncfusion Team October 24, 2022 07:48 AM UTC

Hi Davi, 

  

 # Regarding when adding and removing items in BlackoutDate

As per the instruction we have followed to check the reported issue and we are unable to replicate the issue from our end. We have prepared a simple sample based on the shared details, please find the attached sample for the same,


Additional information

Tested device: iPhone simulator and moto device

SfSchedule version: 20.3.50

Xamarin Forms: 5.0.0.2515

  

Could you please check our sample and let us know if you still facing the same issue? If not, please modify our sample to reproduce the issue which will be helpful for us to check on it and provide you the solution as soon as possible. 

  

Regards, 

Muniappan S


Attachment: ScheduleXamarin_a0ebf4d.zip

Loader.
Up arrow icon