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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

RangeSelection and SelectedDates on ios

Thread ID:

Created:

Updated:

Platform:

Replies:

147002 Aug 28,2019 08:14 AM UTC Oct 4,2019 12:50 PM UTC Xamarin.Forms 4
loading
Tags: SfCalendar
jens de rijcke
Asked On August 28, 2019 08:34 AM UTC

Hello

I am using a SfCalendar with RangeSelection. I am using calendar.SelectedDates.Count in my code, this works fine on android and I get the amount, but when I try the exact same thing on ios it always is 0, not null but 0. It's probably a bug, can you let me know if it is? I suspect that there are simply no selected dates.

Regards
Jens De Rijcke

Subburaj Pandian Veluchamy [Syncfusion]
Replied On August 29, 2019 10:41 AM UTC

Hi Jens, 
 
Thank you for contacting Syncfusion support. 

We have checked your query “SelectedDates property of calendar not returning correct count” in Xamarin.Forms.iOS. SelectedDates property is only for the MultiSelection SelectionMode in Calendar, not for the RangeSelection. We have mentioned the same in our User Guide documentation as well,

UG link: https://help.syncfusion.com/xamarin/sfcalendar/calendar-mvvm#binding-selecteddates

Although we have considered this behavior difference “SelectedDates property gives value for RangeSelection in Android” as a defect and internally logged the defect report for the same. We will update this behavior as common (all platforms) in our upcoming releases. 
 
Your requirement of “Getting Selected Range dates and it’s count in calendar” can be achieved in two ways. Using SelectedRange property of Calendar, you can get the Start and End of the Selected Range and DateAdded property of SelectionChangedEventArgs in the SelectionChanged event of Calendar, you can get the selected dates collection within the range. Please refer the following code snippet, 
 
[C#] 
 
calendar.SelectionChanged += Calendar_SelectionChanged;            
 
        private void Calendar_SelectionChanged(object sender, Syncfusion.SfCalendar.XForms.SelectionChangedEventArgs e) 
        { 
            // You can get the SelectedRange Start date and End date 
            var selectedRange = calendar.SelectedRange; 
            // Using this can get the selected date collection within the range 
            var selectedDateCollection = e.DateAdded; 
           // Get the selected dates count 
            var selectedDatesCount = e.DateAdded.Count; 
        } 
 
We have attached the sample for your reference,

Sample link: CalendarRangeSelection_Sample 

In SelectionChangedEventArgs of the SelectionChanged event, you can get the DateAdded, DateRemoved and NewRangeAdded values.

We hope this helps. Please let us know, if you would require any further assistance. 
 
Regards,
Subburaj Pandian V   


jens de rijcke
Replied On August 30, 2019 06:54 AM UTC

Hello

I solved it with the e.DateAdded. It's just weird that it behaves different while it is multiplatform. So that makes that it is unusable in my application.
Anyway, thanks.

Regards
Jens De Rijcke

Subburaj Pandian Veluchamy [Syncfusion]
Replied On August 30, 2019 10:08 AM UTC

Hi Jens De Rijcke,  
   
Thank you for the update. We are glad that the given solution meets your requirement. 

As we mentioned, we will update this behavior as common in all platforms in our upcoming releases.  
 
Please let us know, if you would require any further assistance. We will happy to assist you. 
  
Regards,
Subburaj Pandian V  


Indumathi Ravichandran [Syncfusion]
Replied On October 4, 2019 12:50 PM UTC

Hi Jens, 
 
We are glad to announce that our Essential Studio 2019 Volume 3 Release version 17.3.0.14 is rolled out with the requested behavior change “SelecedDates property gives the value for RangeSelection in Android” and is available for download under the following link. 
  
 
Nuget link: 
 
Release notes link: 
 
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,     
Indumathi 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

Live Chat Icon For mobile
Live Chat Icon