Change weekend cell backgroud color

Hi,

Is it possible to change weekend cells backgroud color?

Thanks


3 Replies

SS SaiGanesh Sakthivel Syncfusion Team November 4, 2021 04:20 AM UTC

Hi Fernando, 
 
Thank you for using Syncfusion products. 
 
#Regarding Changing the Weekend cell background color 
We have checked the reported query from our end. Your requirement can be achieved with help of MonthCellLoadedEvent in SfSchedule. please refer to the following code snippet for your reference. 
 
Code snippet 
private void Schedule_OnMonthCellLoadedEvent(object sender, MonthCellLoadedEventArgs e) 
{ 
    if (e.date.DayOfWeek == DayOfWeek.Saturday || e.date.DayOfWeek == DayOfWeek.Sunday) 
    { 
        e.cellStyle = new CellStyle(); 
        e.cellStyle.BackgroundColor = Color.Red; 
                
        if(e.isNextMonthDate || e.isPreviousMonthDate) 
        { 
            e.cellStyle.TextColor = Color.LightGray; 
        } 
    } 
} 
 
Please refer to the sample in the following locations. 
 
Please let us know if you have any concerns.

Regards,
SaiGanesh Sakthivel
 



FE Fernando November 4, 2021 10:17 AM UTC

Thank you very much!

It's perfect.



SS SaiGanesh Sakthivel Syncfusion Team November 8, 2021 06:07 AM UTC

Hi Fernando, 
 
Thank you for the update.  
  
We are glad to know that the given solution helped to achieve your requirement. Please let us know if you need any further assistance.  
  
Regards,  
SaiGanesh Sakthivel 


Loader.
Up arrow icon