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

Change color of active days in calendar

1 Answer 110 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Patrick Hone
Top achievements
Rank 1
Patrick Hone asked on 27 Sep 2009, 10:51 PM
Hi there,

We are using the RadCalendar, Version: 2008.2 1001 and have managed to set a dynamic date range where the inactive days are faded and the active days bolded. 

There is the class...

.outOfRange_Telerik span

which sets the inactive days to a certain colour. And.....

.TableLayout_Telerik a,
.TableLayout_Telerik span


Which sets the active days in the range to a another colour.

Now in the active date range only some of the days are actually active where the user can physically click on the days but we are not sure whether or not we can set these days to a specific colour in the css as well. Can this be done?

Many thanks,

Patrick

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 28 Sep 2009, 09:41 AM
Hello Patrick,

You can use the server and client DayRender events to modify the appearance of calendar days:

http://demos.telerik.com/aspnet-ajax/calendar/examples/programming/customdaycellrendering/defaultcs.aspx

http://www.telerik.com/help/aspnet-ajax/calendar_serversidedayrender.html

http://www.telerik.com/help/aspnet-ajax/calendar_clientsideondayrender.html

The server DayRender event is used for the Calendar's initial look, while the client event is used when navigating to other months on the client.

The recommended thing to do is set a custom CSS class for given days (applied to the <td>) and use a CSS rule to modify the styles of the <a> or <span> elements inside the table cell.


Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Calendar
Asked by
Patrick Hone
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or