This is a migrated thread and some comments may be shown as answers.

change backgroundcolor at several specific time

2 Answers 77 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
秋雲
Top achievements
Rank 1
秋雲 asked on 20 Feb 2014, 03:44 AM
HI telerik members:

How can i make radscheduler controller change  backgroundcolor  at several specific time if i make holiday on radschedule ? 
( for example   holiday or weekend ?) 

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Feb 2014, 11:15 AM
Hello,

Thank you for contacting us.

RadScheduler uses a logical layer for storing appointment and view data and the visual elements that represent this data are occasionally being refreshed. In order to customize the properties of the cell elements, you should use the CellFormatting event. Here is a sample code snippet, demonstrating how to change the BackColor for the specific CellElement if its date is Saturday or Sunday:
private void radScheduler1_CellFormatting(object sender, SchedulerCellEventArgs e)
{
    if (e.CellElement.Date.DayOfWeek == DayOfWeek.Saturday ||
        e.CellElement.Date.DayOfWeek == DayOfWeek.Sunday)
    {
        e.CellElement.BackColor = Color.Pink;
    }
    else
    {
        e.CellElement.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local);
    }
}

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
0
秋雲
Top achievements
Rank 1
answered on 26 Feb 2014, 01:46 AM
Thank you

it solved my problem, This article is really good.
Tags
Scheduler and Reminder
Asked by
秋雲
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
秋雲
Top achievements
Rank 1
Share this question
or