Articles in this section
Category / Section

How to show and customize week number in the .NET MAUI Calendar?

1 min read

In the Syncfusion .NET MAUI Calendar control, you can show and customize the week number in the SfCalendar’s MonthView.

Step 1: Create the SfCalendar control and set the ShowWeekNumber property of CalendarMonthView to true, as shown in the following code sample.

 

XAML

<calendar:SfCalendar x:Name="calendar">
    <calendar:SfCalendar.MonthView>
        <calendar:CalendarMonthView ShowWeekNumber="True">
        </calendar:CalendarMonthView>
    </calendar:SfCalendar.MonthView>
</calendar:SfCalendar>

 

Step 2: You can customize the week number background using the Background property of CalendarWeekNumberStyle. Also, you can customize the week number text using the CalendarTextStyle properties: TextColorFontSizeFontAttributes, and FontFamily.

 

XAML

<calendar:CalendarMonthView.WeekNumberStyle>
    <calendar:CalendarWeekNumberStyle Background="DeepSkyBlue">
        <calendar:CalendarWeekNumberStyle.TextStyle>
            <calendar:CalendarTextStyle TextColor="White"
                                        FontSize="15"
                                        FontAttributes="Bold,Italic"/>
        </calendar:CalendarWeekNumberStyle.TextStyle>
    </calendar:CalendarWeekNumberStyle>
</calendar:CalendarMonthView.WeekNumberStyle>

 

View sample on GitHub

 

Output

 

Show and Customize week number using Syncfusion .NET MAUI Calendar

 

Conclusion

 

Hope you enjoyed learning about how to show and customize the week number in the .NET MAUI Calendar (SfCalendar).

You can 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, you can check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our .NET MAUI Calendar and other .NET MAUI components.

If you have any queries or require clarifications, please let us know in the comments below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied