)
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

How to use range selection on SfCalendar by using MVVM pattern

Platform: Xamarin.Forms |
Control: SfCalendar |
Published Date: March 15, 2018 |
Last Revised Date: March 15, 2018

SfCalendar allows us to select a range of date in a month by setting SelectionMode property to RangeSelection.

RangeSelection can be achieved by either dragging on the range of dates which we need to select or by taping on to the Start date and End date.

Here we have explained the RangeSelection by using a simple ViewModel sample.

 

MainPage: XAML

View for SfCalendar and the buttons which will be used to save the selected range.

 

 

Main Page : C#

 

 

 

ViewModel: C#

 

ViewModel page which contains the binding properties.

 

 

 

Model: C#

 

Model page which contains the range of selected dates in a collection.

 

 

 

 

 

 

 

 Selecting a range of Dates:                 

 

 

 

Retrieving Selected Range:

 

 

 

                              

 

                                                                                                                        

 

Sample link:

Download the complete sample from the below given link.

 Sample

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
ben
Jan 30, 2019

Please explain this code.

Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

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