change backgroundcolor at several specific time

3 posts, 0 answers
  1. 秋雲
    秋雲 avatar
    2 posts
    Member since:
    Feb 2014

    Posted 19 Feb 2014 Link to this post

    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. Dess
    Admin
    Dess avatar
    1607 posts

    Posted 24 Feb 2014 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. 秋雲
    秋雲 avatar
    2 posts
    Member since:
    Feb 2014

    Posted 25 Feb 2014 in reply to Dess Link to this post

    Thank you

    it solved my problem, This article is really good.
Back to Top