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

selectedAppointment always null

Hi,
I'm using a sfSchedule Control (Xamarin.Forms) using DataBinding and View/ViewModel Logic. I'm populating my schedule with a list of  ScheduleAppointment in a ScheduleAppointmentCollection that is binded in with my View.  I can see all my appointment correctly. When i click one of my appointment,the ScheduleCellTapped event is raised correctly but the selectedAppointment of ScheduleTappedEventArgs is always null. How can I fix this problem? thanks

26 Replies

NM Nijamudeen Mohamed Sulaiman Syncfusion Team April 4, 2016 11:58 AM UTC

Hi Luca,

Thank you for contacting Syncfusion Support.

We have already logged an issue report for the same. But could you please provide us the following details to confirm the issue?

1. Issue reproducing platform (Xamarin Forms(iOS), Xamarin Forms (Android)) with version.
2. System Date and Time Zone details.
3. Simple issue reproducing sample or code snippet (if possible).

It will be helpful for us to analyze on it and provide you a possible solution.

Regards,
Nijamudeen M.


LF Luca Franceschini April 4, 2016 02:18 PM UTC

I'm working with both platforms and I have the same problem with Android and IOS.
I Found the same problem using your "Appointment_editor" of  "SampleBrowser-Forms" examples.  
When i click on an existent appointment, the ScheduleCellTapped event is raised , the ScheduleTappedEventArgs has the right dateTime and Schedule,but the selectedAppointment is always null :


        void Schedule_CellTapped(object sender, ScheduleTappedEventArgs args)
        {
            if (args.selectedAppointment != null)
            {
                   .........
            }

this method is called when i click an appointment, but args.selectedAppointment  is always null


SG Swathi Gopal Syncfusion Team April 13, 2016 09:06 AM UTC

Hi Luca,


We have created a support incident under your account to track the status of this issue. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know, if you have any query.

Regards,

Swathi G



JO JOSE August 16, 2016 02:35 PM UTC

I face exactly the same problem, once the ScheduleCellTapped event is raised no matter if you choose a cell with or without an event, in any case you receive a null value in selectedAppointment attribute. I'm using Xamarin Forms, is there any solution or any workaround?

Thanks.

SfSchedule sf = new SfSchedule();
sf.ScheduleCellTapped += (Object sender, ScheduleTappedEventArgs e) =>
      {
                Console.WriteLine("CELL TAPPED");
                ScheduleAppointment ap = (ScheduleAppointment)e.selectedAppointment;
                if (e.selectedAppointment != null) Console.WriteLine("appoinment:"+ap.Subject);
      };



SP Subburaj Pandian Veluchamy Syncfusion Team August 17, 2016 01:23 PM UTC

Hi Jose,

Thank you for using Syncfusion products.

We have checked and we are unable to reproduce the mentioned issue with “SelectedAppointment in Schedule Xamarin Forms” from our side. We have prepared a sample based on your requirement, please find the sample below,

Sample link: ScheduleTestingSample

If the provided sample doesn’t work, could you please revert us by modifying the provided sample with more information (ScheduleView, Locale) along with its replication procedure, so that we could analyze on it and provide you a solution.

Regards,
Subburaj Pandian V.





FJ Francisco José Espina Aragón replied to Subburaj Pandian Veluchamy December 8, 2016 10:04 PM UTC

Hi Jose,

Thank you for using Syncfusion products.

We have checked and we are unable to reproduce the mentioned issue with “SelectedAppointment in Schedule Xamarin Forms” from our side. We have prepared a sample based on your requirement, please find the sample below,

Sample link: ScheduleTestingSample

If the provided sample doesn’t work, could you please revert us by modifying the provided sample with more information (ScheduleView, Locale) along with its replication procedure, so that we could analyze on it and provide you a solution.

Regards,
Subburaj Pandian V.




I have the same incidence.

I downloaded the sample from the previous note (Sample link: ScheduleTestingSample) and it works correctly.

The difference I see is that my project is with XAML Pages and using behaivors.

I am using my user class EventToCommandBehavior:

      <sf:SfSchedule
        ScheduleView = "{Binding TypeView, Mode = TwoWay}"
        DataSource = "{Binding AppointmentCollection}"
        Locale = "es"
        ShowAppointmentsInline = "True">
      
          <sf:SfSchedule.Behaviors>
          
            <local:ScheduleCellTappedBehaivor Command = "{Binding CellTappedCommand}" />
          
            <local:EventToCommandBehavior EventName = "MonthInlineAppointmentTapped"
                                          Command = "{Binding MonthInlineTappedCommand}"
                                          Converter = "{StaticResource ScheduleMonthInlineTappedConverter}" />
                                        
          </sf:SfSchedule.Behaviors>
        </ Sf:SfSchedule>

I have my own Converter classes, for example:


    public class MonthInlineAppointmentTappedEventArgsToAppointmentConverter: IValueConverter
    {
        public object Convert (object value, Type targetType, object parameter, CultureInfo culture)
        {
            var eventArgs = value as MonthInlineAppointmentTappedEventArgs;
            return eventArgs.selectedAppointment;
        }

        public object ConvertBack (object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException ();
        }
    }


The problem is in the line: "eventArgs.selectedAppointment"

Debugging I see that "eventArgs.Schedule" and "eventArgs.datetime" have non-null values, but "eventArgs.selectedAppointment" in IOS always comes with NULL value.

On Android and UWP works ok.


SG Swathi Gopal Syncfusion Team December 9, 2016 10:53 AM UTC

Hi Jose, 

We have created a support incident under your account to track the status of this issue. Please log on to our support website to check for further updates. 

Please let us know, if you have any query. 
  
Regards,
Swathi G 



SH steve hawkins replied to Swathi Gopal December 12, 2016 12:06 PM UTC

Hi Jose, 

We have created a support incident under your account to track the status of this issue. Please log on to our support website to check for further updates. 

Please let us know, if you have any query. 
  
Regards,
Swathi G 


I'm getting exactly the same issue on iOS
.

Using xcml from end binding to a view model
. Binding work fine and data passed back but 'selected appointment' is always null


SP Subburaj Pandian Veluchamy Syncfusion Team December 13, 2016 12:18 PM UTC

Hi Steve, 
 
We have created a support incident under your account to track the status of this issue. Please log on to our support website to check for further updates. 
 
  
Please let us know, if you have any query.

Regards,
 
Subburaj Pandian V

 



IS Ione Souza Junior January 6, 2017 07:29 PM UTC

Hi, any news about selectedAppointment null?


SP Subburaj Pandian Veluchamy Syncfusion Team January 9, 2017 06:40 AM UTC

Hi Lone Souza,   
 
We have already fixed the mentioned issue “SelectedAppointment is null in Xamarin forms (iOS)” and included the issue fix our latest Essential Studio 2016 Volume 4 Service Pack Release v14.4.0.20 and is available for download under the following link. 
  
 
Please let us if you would require any further assistance.  
 
Regards,  
Subburaj Pandian V.   



RL Renaud Laloire January 10, 2017 03:09 PM UTC

Syncfusion,

I have the same problem on Android and I am using the version 14.4.0.20

I suppose it is not fixed then ;)

Regards,

Renaud


SP Subburaj Pandian Veluchamy Syncfusion Team January 11, 2017 06:43 AM UTC

  
Hi Renaud, 
 
Thank you for your interest in Syncfusion products. 
 
Based on the provided information, we are unable to reproduce the mentioned issue SelectedAppointment is null in Schedule Xamarin Forms (Android) from our side. We have prepared the simple sample, please find the below sample,

Sample Link: SelectedAppointmentSample 
 
If the given solution also doesn’t meet your requirement, could you please modify the provided sample along with its reproducing procedure? It will be helpful for us to analyze on your requirement and provide you a better solution.

 
Regards,   
Subburaj Pandian V.  



RL Renaud Laloire January 17, 2017 01:11 PM UTC

Dear Syncfusion,

I finally been able to identify the bug : When displaying the SfSchedule in a single page, it works fine. But if you use a ViewPager (android control for carousel) which contains the SfSchedule, it is broken. It is like you return the tapped appointment based on the tap position on the screen or something and since the SfSchedule is in a viewpager, it cannot find the clicked appointment.

I needed to have a swipable ViewPager to go from the appointments of one person to another. When displaying only one person, it works but as soon as I had additional persons (page in the ViewPager), it broke.

Can you identify why it follows this behavior and if yes, do you have any idea on a fix ? I use this for the implementation of the ViewPager : https://github.com/alexrainman/CarouselView

Regards,

Renaud Laloire


RL Renaud Laloire January 17, 2017 01:23 PM UTC

Additional thoughts : it might be due to the fact that I have several SfSchedule instantiated at the same time and when I click on an appointment could it be that it tries to find it in another instance of SfSchedule ... ? Just an assomption ...


SP Subburaj Pandian Veluchamy Syncfusion Team January 18, 2017 01:28 PM UTC

Hi Renaud,  
 
Thank you for the update.  
 
Based on the provided information we have checked your requirement Schedule with swipe-able ViewPager for Appointments in Xamarin Forms, tabs with content that support the swipe gesture has not recommendable one. Since we have handled swipe gestures for navigating in the ScheduleView’s, so that while using Schedule in the carousel has not a recommendable. Could you please let us know if you have any query while using Schedule control with more details, it will be helpful for us to analyze on it and provide you a better solution.

 
Regards,   
Subburaj Pandian V.  



RL Renaud Laloire January 19, 2017 09:35 AM UTC

Subburaj Pandian V

I solved my problem by removing the use of ViewPager. For displaying several people schedule, I keep now only one instance of the SfSchedule but I change the DataSource each time on the fly. Reloading data goes fast so I am good with that.

Since I don't have a ViewPager and I only have one SfSchedule, the clicked appointment is never null.

That being said, for future update, I still think that the SfSchedule should work inside a ViewPager.

Thanks for your feedback,

Regards,

Renaud


SP Subburaj Pandian Veluchamy Syncfusion Team January 20, 2017 01:02 PM UTC

 
Hi Renaud,  
  
Thank you for the update.  
  
Based on the provided information, we are unable to reproduce the mentioned issue with Schedule in Xamarin Forms from our side. Could you please provide us more information about the issue by modifying the given sample (SelectedAppointmentSample) with its reproducing procedure? It will be helpful for us to analyze on your requirement and provide you a better solution.

 
Regards,    
Subburaj Pandian V.   



JE Jeronimo February 18, 2017 01:36 AM UTC

Hi, 
I had the same problem but I found it happen only on MonthView. If I switch to DayView from last, and then click on appointment cell everything works fine and can get the selected appointment. I hope could help to someone.


SP Sivakumar Punniya Moorthi Syncfusion Team February 20, 2017 09:09 AM UTC

Hi Jeronimo, 

  

Thank you for the update.  

  

We have created a new support incident under your account to track the status of this issue. Please log on to our support website to check for further updates. 

  

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

  

Please let us know, if you have any query.

Regards,
 

Sivakumar P


JL Jon Lacey October 9, 2017 10:40 AM UTC

I am getting the same problem with MonthView, I am using 15.3.0.33.

I have a very simple app built in Visual Studio 2017.

The appointment displays correctly in both Week and Month view but the appointment is always empty on CellTapped on the MonthView.

If I set showAppointmentsInline = true and click on the cell, the correct data is shown inline but the CellTapped event has a null Appointment 

Is this still broken?



SP Subburaj Pandian Veluchamy Syncfusion Team October 10, 2017 12:54 PM UTC

Hi Jon Lacey, 
   
We have created a new support incident under your account to track the status of this query. Please log on to our support website to check for further updates. 
 
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Regards,
Subburaj Pandian V   



SH steve hawkins October 10, 2017 01:10 PM UTC

weirdly enough I found  that if I removed the appointment style in code for the view it passed back the appointment as it should. If i add the appointmentstyle back in code (viewmodel) then the appointment comes back as null.




SP Subburaj Pandian Veluchamy Syncfusion Team October 11, 2017 09:18 AM UTC

Hi Steve, 
   
We have created a new support incident under your account to track the status of this query. Please log on to our support website to check for further updates. 
 
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Regards,
Subburaj Pandian V   



SH Shelby April 5, 2018 06:53 PM UTC

I have a custom Event class that I am mapping to the SFSchedule but the MonthInlineAppointmentTappedEventArgs.Appointment is always null for both iOS and Android. Is this resolved yet?


GC Ganeshamoorthy Chandramoorthy Syncfusion Team April 6, 2018 06:36 PM UTC

Hi Shelby, 
 
We have checked with the provided information and the issue “MonthInlineAppointment always null for custom events” is not exists in our latest version (16.1.0.32). We have prepared a simple sample with custom appointment. Kindly find the sample below, 
 
Sample: Sample 
 
Could you please check with the provided sample and revert us whether issue prevails? Else, kindly modify the provided sample with issue replication procedure. So that it will be helpful for us to analyze and provide you better solution. 
 
Regards, 
Ganeshamoorthy C 


SIGN IN To post a reply.
Loader.
Live Chat Icon For mobile
Up arrow icon