Category / Section
How to customize week number using DataTemplate in WPF Scheduler (Calendar)
1 min read
You can customize the default appearance of a week number template in month view by using the WeekNumberTemplate property of MonthViewSettings in WPF SfScheduler.
XAML
Display the week number of a year in the scheduler month view by setting the ShowWeekNumber to true in the MonthViewSettings and customize the week number appearance by using the WeekNumberTemplate property of MonthViewSettings.
<Grid> <syncfusion:SfScheduler x:Name="Schedule" ViewType="Month" > <syncfusion:SfScheduler.MonthViewSettings> <syncfusion:MonthViewSettings ShowWeekNumber="True"> <syncfusion:MonthViewSettings.WeekNumberTemplate> <DataTemplate> <Grid > <Label Foreground="Red" Content="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center" FontStyle="Oblique"> </Label> </Grid> </DataTemplate> </syncfusion:MonthViewSettings.WeekNumberTemplate> </syncfusion:MonthViewSettings> </syncfusion:SfScheduler.MonthViewSettings> </syncfusion:SfScheduler> </Grid>