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

Formatting Scheduler Resource Header Cell Element

3 Answers 183 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 22 Aug 2016, 07:27 PM
Using the Visual Style Builder to set theme colors I can see how to modify the Scheduler Header Cell Element, but where is the Resource Header Cell Element modified?  I would to set this in the theme because my application allows loading of predefined themes; therefore I prefer not to use the SchedulerCell_Format event.  Thank you for any guidance you can provide.

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Aug 2016, 07:20 AM
Hello Allen,

Thank you for writing. 

SchedulerResourceHeaderCellElement's color depends on the resource's color that is applied. It is not possible to customize the SchedulerResourceHeaderCellElement in Visual Style Builder. Feel free to use the CellFormatting event and apply the desired style to the header cells. Here is a sample code snippet:
Font f = new Font("Arial", 14f, FontStyle.Italic);
 
private void radScheduler1_CellFormatting(object sender, SchedulerCellEventArgs e)
{
    SchedulerResourceHeaderCellElement headerCell = e.CellElement as SchedulerResourceHeaderCellElement;
    if (headerCell != null)
    {
        headerCell.Font = f;
    }
    else
    {
        e.CellElement.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local);
    }
}

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

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Allen
Top achievements
Rank 1
answered on 23 Aug 2016, 08:41 PM
Thanks.  That helped get me going down the right road.  Is there a way to turn off the resource color from being applied to the Scheduler Cell elements?  I understand how to change the header cell format, but by default it looks like a percentage of the resource color is being "overlayed" on the scheduler cell colors.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 24 Aug 2016, 01:36 PM
Hello Allen, 

Thank you for writing back. 

In order to customize the cell's back color, you can set the CellElement.BackColor property. In addition, it is necessary to set the Opacity property to to obtain the desired color.
private void radScheduler1_CellFormatting(object sender, SchedulerCellEventArgs e)
{
    e.CellElement.Opacity = 1;
    SchedulerResourceHeaderCellElement headerCell = e.CellElement as SchedulerResourceHeaderCellElement;
    if (headerCell != null)
    {
        headerCell.BackColor = Color.Pink;
        headerCell.GradientStyle = GradientStyles.Solid;
    }
    else if (e.CellElement is SchedulerCellElement && e.CellElement.Date.Year > 1999 && e.CellElement.Text == string.Empty)
    {
        e.CellElement.BackColor = Color.Yellow;
        e.CellElement.GradientStyle = GradientStyles.Solid;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
        e.CellElement.ResetValue(LightVisualElement.OpacityProperty, ValueResetFlags.Local);
    }
}

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
Scheduler and Reminder
Asked by
Allen
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Allen
Top achievements
Rank 1
Share this question
or