Category / Section
How to Edit DayNameCell using DayNameCellsStyle in CalenderEdit ?
1 min read
DayNameCell can be edited by DayNameCellsStyle property of CalenderEdit with the target type as DayNameCell.
The same has been explained in the following code snippet:
XAML:
//Code Explains how to edit DayNameCell using DayNameCellsStyle property <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:syncfusion="http://schemas.syncfusion.com/wpf" x:Class="CalenderEdit_DayCellBackround_.MainWindow" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <Style x:Key="DayCellBackroud" TargetType="{x:Type syncfusion:DayNameCell}"> <Setter Property="Background" Value="Green"></Setter> </Style> </Window.Resources> <Grid> <syncfusion:CalendarEdit x:Name="Calender1" Width="200" DayNameCellsStyle="{StaticResource DayCellBackroud}" /> </Grid> </Window>
C#:
//Code Explains how to edit DayNameCell using DayNameCellsStyle property namespace CalenderEdit_DayCellBackround { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Style style = this.FindResource("DayCellBackroud") as Style; Calender1.DayNameCellsStyle = style; } } }
Output: