Completed
Last Updated: 24 Feb 2021 14:07 by ADMIN
Imported User
Created on: 14 Sep 2015 11:47
Category: Calendar
Type: Feature Request
0
Enable the ItemStyle property of radCalendar SpecialDays when we created those in code behind
When we create special days for radCalendar in code behind, we are notre able to set the ItemStyle property because it is readonly.

This property should be opened for assignment like we are able to do so when we create SpecialDays in the html script.

Thank you,

Alain
1 comment
ADMIN
Attila Antal
Posted on: 24 Feb 2021 14:07

Hi Alain,

The ItemStlye property itself is Read-Only, but the Child properties are not. Those are the actual properties you will need to assign values to.

Here is how it works:

HTML/XML

Even in the markup, you're setting the values to the ItemStyle's child properties.

<telerik:RadCalendarDay>
    <ItemStyle CssClass="someClass" ForeColor="Red" />
</telerik:RadCalendarDay>

OR

Inline declaration

<telerik:RadCalendarDay ItemStyle-CssClass="someClass" ItemStyle-ForeColor="Red">
</telerik:RadCalendarDay>

 

C#

Setting values to Child properties of the ItemStyle

var calendarDay = new RadCalendarDay();

calendarDay.ItemStyle.CssClass = "someClass";
calendarDay.ItemStyle.ForeColor = System.Drawing.Color.Red;

 

VB

Setting values to Child properties of the ItemStyle

Dim calendarDay = New RadCalendarDay()
calendarDay.ItemStyle.CssClass = "someClass"
calendarDay.ItemStyle.ForeColor = System.Drawing.Color.Red

 

Regards,
Attila Antal
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.