diff --git a/MAUI/Calendar/images/views/autofit-calendar.gif b/MAUI/Calendar/images/views/autofit-calendar.gif new file mode 100644 index 0000000000..cd15a52319 Binary files /dev/null and b/MAUI/Calendar/images/views/autofit-calendar.gif differ diff --git a/MAUI/Calendar/views.md b/MAUI/Calendar/views.md index b4638237b9..3429dcd5b2 100644 --- a/MAUI/Calendar/views.md +++ b/MAUI/Calendar/views.md @@ -124,6 +124,46 @@ this.calendar.MonthView = new CalendarMonthView() ![Customize Week number Appearance in .NET MAUI Calendar.](images/views/net-maui-month-view-show-week-numbers-customize.png) +### Autofit +Autofit dynamically adjusts the month row height based on the number of weeks in the current month. It is available only in the `Month view` when: +* [ShowTrailingAndLeadingDates](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.SfCalendar.html?tabs=tabid-6%2Ctabid-12%2Ctabid-18%2Ctabid-50%2Ctabid-10%2Ctabid-8%2Ctabid-14%2Ctabid-4%2Ctabid-22%2Ctabid-26%2Ctabid-24%2Ctabid-16%2Ctabid-2%2Ctabid-20#Syncfusion_Maui_Calendar_SfCalendar_ShowTrailingAndLeadingDates) is set to `false`, and +* [Mode](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.SfCalendar.html#Syncfusion_Maui_Calendar_SfCalendar_Mode) is [Dialog](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.CalendarMode.html#Syncfusion_Maui_Calendar_CalendarMode_Dialog) or [RelativeDialog](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.CalendarMode.html#Syncfusion_Maui_Calendar_CalendarMode_RelativeDialog). + +N> +Autofit is Not applicable when +* [NumberOfVisibleWeeks](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.CalendarMonthView.html?tabs=tabid-2#Syncfusion_Maui_Calendar_CalendarMonthView_NumberOfVisibleWeeks) is less than 6. +* [PopupHeight](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Calendar.SfCalendar.html?tabs=tabid-6%2Ctabid-12%2Ctabid-18%2Ctabid-50%2Ctabid-10%2Ctabid-8%2Ctabid-14%2Ctabid-4%2Ctabid-22%2Ctabid-26%2Ctabid-24%2Ctabid-16%2Ctabid-2%2Ctabid-20#Syncfusion_Maui_Calendar_SfCalendar_PopupHeight) is less than or equal to 0. + +{% tabs %} +{% highlight xaml tabtitle="MainPage.xaml" %} + + + + + + +{% endhighlight %} +{% highlight c# tabtitle="MainPage.xaml.cs" %} + +private void Button_Clicked(object sender, EventArgs e) +{ + this.calendar.IsOpen = true; +} + +{% endhighlight %} +{% endtabs %} + +![Autofit in .NET MAUI Calendar.](images/views/autofit-calendar.gif) + ## Year view The Year view displays the current year's month. A calendar year is a one-year period that begins on January 1 and ends on December 31. By default, displays the current year's month and the current month is highlighted by a separate color that is different from the rest of the month color in the `Year view`. You can easily navigate to the desired month dates from the year view.