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