How to Customize the Leading and Trailing Dates of Month Cells in the .NET MAUI Calendar (SfCalendar)?
In this article, you will learn how to customize the leading and trailing dates of the SfCalendar month cell in the Syncfusion® .NET MAUI Calendar control.
Background Customization
Modify the background of the leading and trailing dates using the TrailingLeadingDatesBackground property of the CalendarMonthView, as shown in the following code sample.
XAML
<calendar:SfCalendar x:Name="calendar"> <calendar:SfCalendar.MonthView> <calendar:CalendarMonthView TrailingLeadingDatesBackground="#FEB8B8"> </calendar:CalendarMonthView> </calendar:SfCalendar.MonthView> </calendar:SfCalendar>
Text Style Customization
Style the text of the leading and trailing dates using the TrailingLeadingDatesTextStyle‘s CalendarTextStyle properties such as TextColor, FontSize, FontFamily, and FontAttributes, as shown in the following code sample.
XAML
<calendar:CalendarMonthView.TrailingLeadingDatesTextStyle> <calendar:CalendarTextStyle TextColor="#FFFFFF" FontSize="15" FontAttributes="Bold,Italic" /> </calendar:CalendarMonthView.TrailingLeadingDatesTextStyle>
Download the complete sample on GitHub
Output:
Conclusion
I hope you enjoyed learning how to customize the leading and trailing dates of the month cells in the .NET MAUI Calendar (SfCalendar).
Refer to our .NET MAUI Calendar’s feature tour page to learn about its other groundbreaking feature representations. You can explore our .NET MAUI Calendar documentation to understand how to present and manipulate data.
For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Calendar and other .NET MAUI components.
Please let us know in the comments section below if you have any queries or require clarifications. Contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!