Disable swiping / drag to change view

Afternoon SF team,

With the sfcalendar, is there a way to stop users from swiping / clicking & dragging on the view to go to the next or previous month view? I thought there might be an option on NavigationDirection of "None" but unfortunately its only Horizontal and Vertical

King regards,
Josh


3 Replies 1 reply marked as answer

IR Indumathi Ravichandran Syncfusion Team July 22, 2024 05:42 AM UTC

Hi Josh,


Regarding Query: is there a way to stop users from swiping / clicking & dragging on the view to go to the next or previous month view?


As per the current implementation, there is no direct support to stop the swiping to prev and next views. But by using the MinimumDate and MaximumDate property of the calendar, you can restrict the navigation beyond the mentioned dates. Please find the UG documentation for the same.


UG links:

https://help.syncfusion.com/maui/calendar/date-restrictions#minimum-date

https://help.syncfusion.com/maui/calendar/date-restrictions#maximum-date


We have a KB documentation for the same. Please find the documentation from the following link.

KB link:


https://support.syncfusion.com/kb/article/12269/how-to-restrict-calendar-within-date-limits-in-net-maui


Also, by using AllowViewNavigation property of the calendar you can enable/ disable year, decade and century through cell interaction. Please find the UG documentation from the following link.


https://help.syncfusion.com/maui/calendar/date-navigation#allow-view-navigation


You can restrict the date selection/ clicking by using the below properties.


EnablePastDates – By setting the value as false, you can disable the dates before the today and restrict the selection for those dates.


https://help.syncfusion.com/maui/calendar/date-restrictions#enable-past-dates


SelectableDayPredicate – By using this, you can disable the particular selected date in a calendar. Please find the documentation from the following link.


https://help.syncfusion.com/maui/calendar/date-restrictions#selectable-day-predicate


We hope that this helps you. Please let us know if you need further assistance. We are happy to assist you.


Regards,

Indumathi R


Marked as answer

JS Josh Southern July 25, 2024 01:48 PM UTC

Hi Indumathi,

I've used the max / min dates and it



IR Indumathi Ravichandran Syncfusion Team July 26, 2024 04:29 AM UTC

Hi Josh,


Thank you for the update. We are glad to know that the issue will be resolved at your end. Please get in touch with us if you require any further assistance.


Regards,

Indumathi R


Loader.
Up arrow icon