Articles in this section
Category / Section

How to show week numbers and customize the week number cells

1 min read

In Calendar control we can include week number and also this can be customized. To display week numbers in calendar enable ShowWeekNumbers property. To customize week number cells use the below properties

  • WeekNumberBackground
  • WeekNumberBorderBrush
  • WeekNumberCornerRadius
  • WeekNumberBorderThickness
  • WeekNumberForeground

XAML

<syncfusion:CalendarEdit Background="AliceBlue" Name="calendarEdit" sf:SkinStorage.VisualStyle="Metro" ShowWeekNumbers="True"  WeekNumberBackground="DeepSkyBlue" WeekNumberForeground="WhiteSmoke" WeekNumberBorderBrush="LightBlue" WeekNumberBorderThickness="2" WeekNumberCornerRadius="3"  />
 

 

C#

        public MainWindow()
        {
            InitializeComponent();
            calendarEdit.WeekNumberBackground = Brushes.DeepSkyBlue;
            calendarEdit.WeekNumberForeground = Brushes.WhiteSmoke;
            calendarEdit.WeekNumberCornerRadius = new CornerRadius(3);
            calendarEdit.WeekNumberBorderBrush = Brushes.LightBlue;
            calendarEdit.WeekNumberBorderThickness = new Thickness(2);
        }

 

The following screenshots illustrates the output of the above code example

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