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 databinding and adding appointments, reload data does not update view

Hello,
  I am trying to use SFSchedule within an Xamarin IOS app targeting iPad. I am successful in creating, displaying a month view schedule. I could not get datasource to work, even with the example code as the two methods were never called. So I am adding appointments to a NSMutableArray within a for loop. This occurs after the view constructor and view did load events as I am using MVVM cross viewmodels to retrieve my data, once the data has been retrieved, an event is raised from the viewmodel to the view to bind the appointments to the schedule control. After which I am calling ReloadData. but this is not refreshing the view and showing the added appointments. If I navigate or select any cell, then the appointments are displayed. Is there another method to call to refresh the monthview and display my appointment information?

I have attached a zip with my View class included for reference.




Attachment: ScheduleView_d7fac3a.zip

4 Replies

NM Nijamudeen Mohamed Sulaiman Syncfusion Team March 21, 2016 12:41 PM UTC

Hi James,

Currently we are analyzing on this requirement. We will update you the details in one business day (22nd Mar, 2016). We appreciate your patience until then.

Please let us know, if you have any query.

Regards,
Nijamudeen M.



NM Nijamudeen Mohamed Sulaiman Syncfusion Team March 22, 2016 12:38 PM UTC

Hi James,

We appreciate your patience.

We have analyzed the provided code snippet. Based on your scenario, we have tested SfSchedule by triggering an event to added appointments to the control in that event and it works fine.  Along with AppointmentCollection changed and Appointment property changed is also listened properly for that please refer our sample browser sample (Xamarin -> iOS -> Schedule->AppointmentEditor).


Could you please cross check the data you have provided while creating appointments through the event. If the provided solution doesn’t meet your requirement, please revert us back with simple issue reproducing sample along with its replication procedure (if possible screenshot)? It will be helpful for us to analyze on your requirement and provide you a possible solution.


Please let us know, if you have any query.

Regards,
Nijamudeen M. 



EM Emil replied to James Baldwinson November 16, 2016 04:39 PM UTC

Hello,
  I am trying to use SFSchedule within an Xamarin IOS app targeting iPad. I am successful in creating, displaying a month view schedule. I could not get datasource to work, even with the example code as the two methods were never called. So I am adding appointments to a NSMutableArray within a for loop. This occurs after the view constructor and view did load events as I am using MVVM cross viewmodels to retrieve my data, once the data has been retrieved, an event is raised from the viewmodel to the view to bind the appointments to the schedule control. After which I am calling ReloadData. but this is not refreshing the view and showing the added appointments. If I navigate or select any cell, then the appointments are displayed. Is there another method to call to refresh the monthview and display my appointment information?

I have attached a zip with my View class included for reference.




Attachment: ScheduleView_d7fac3a.zip

Hello James,

I hear you and I believe tha I found a solution for it. If you look at the deep definition of SfSchedule, most of the properties are bindable including ScheduleView. 
If I understand correctly, you need to triger the ScheduleView change in order to refresh the view. So if you are using MVVM like me, you can use it as below

XAML binding;

 <schedule:SfSchedule Grid.Row="1" ScheduleView="{Binding CurrentScheduleView}"

ViewModel:

     private ScheduleView currentScheduleView;

        public ScheduleView CurrentScheduleView
        {
            get { return currentScheduleView; }
            set { currentScheduleView = value;
                RaisePropertyChanged("CurrentScheduleView");
            }
        }

Just a function to twist things in the viewmodel. you can call this one right after your model is loaded in the viewmodel. It should be working. cheers.
 private void TwistScheduleView()
        {
            if (currentScheduleView != ScheduleView.MonthView)
                CurrentScheduleView = ScheduleView.MonthView;
            else
                CurrentScheduleView = ScheduleView.WeekView;
        }

Emil

  


SP Subburaj Pandian Veluchamy Syncfusion Team November 17, 2016 01:07 PM UTC

Hi James/ Emil,

We have checked the mentioned issue with ScheduleAppointment has not added dynamically, appointment adding after updating/refreshing the ScheduleView. we have already fixed this issue could you please ensure with our latest update and no need to update the ScheduleView for this issue. This fix has also included in our volume 4 release 2016 which is expected to available by tomorrow. We will update you once the release has been rolled out.

Please let us know, if you have any query.

Regards,
Subburaj Pandian V 


Loader.
Live Chat Icon For mobile
Up arrow icon