Change style of a date

Hi,

is it possbile to change the style of a date after a the control is load, for example after an elaboration started from a user interaction?

Best regards
Gian Piero Truccolo

3 Replies 1 reply marked as answer

BR Bharathi Rajakantham Syncfusion Team March 18, 2021 11:03 AM UTC

Hi Gian, 

Thanks for contacting Syncfusion Support. 

You can customize the appearance of day cell by using styles and templates in the CalendarEdit control. Please refer the sample and the documentation for your reference. 



If we misunderstood your requirement, please get back with more details on your requirement. 

Regards, 
Bharathi R 



Marked as answer

GI Gian March 18, 2021 11:22 AM UTC

Hi,

is it also possible to apply the style to specific dates?

And also, is it possible show three month instead of one?

Best regards
Gian Piero Truccolo


BR Bharathi Rajakantham Syncfusion Team March 19, 2021 11:16 AM UTC

Hi Gian, 
 
Thanks for contacting Syncfusion Support. 
 
Query1: How to apply the style to specific dates. 
 
You can use SpecialDate.CellTemplate property to customize the SpecialDates of the CalendarEdit. Please refer the sample and the documentation for reference. 
 
 
Code Snippet: 
 
<Window.Resources> 
        <DataTemplate x:Key="SpecialDaysTemplate"> 
            <Grid Background="Aqua"> 
                <TextBlock Text="{Binding Day}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="Red" /> 
            </Grid> 
        </DataTemplate> 
        <local:ViewModel x:Key="ViewModel" > 
            <local:ViewModel.specialDays> 
                <syncfusion:SpecialDate Date="03/03/2021" CellTemplate="{StaticResource SpecialDaysTemplate}"/> 
                <syncfusion:SpecialDate Date="03/06/2021" CellTemplate="{StaticResource SpecialDaysTemplate}"/> 
                <syncfusion:SpecialDate Date="03/17/2021" CellTemplate="{StaticResource SpecialDaysTemplate}"/> 
            </local:ViewModel.specialDays> 
        </local:ViewModel> 
    </Window.Resources> 
 
    <Grid> 
        <syncfusion:CalendarEdit  
            DataContext="{StaticResource ViewModel}" 
            SpecialDates="{Binding specialDays,Mode=TwoWay}"  
            x:Name="dateTimeEdit"  
            Width="300"  
            Height="300" > 
        </syncfusion:CalendarEdit> 
    </Grid> 
 
 
 
Observed Image: 
 
 
Query 2: Possible show three month instead of one? 
 
Currently we don’t support to display three months in our CalendarEdit.  
 
Please let us know if you have any other concerns. We will be glad to assist you. 
 
Regards, 
Bharathi R 


Loader.
Up arrow icon