|
Rank: Member Groups: Member
Joined: 4/9/2010 Posts: 12
|
I am using the calendar control with the multi-month enabled. I currently have the Windows_Multi_Month style selected for testing purposes. Is it possible to have multiple styles applied to different weeks within the calendar? For example.. I set selected dates to be the week of November 20 to 26 and I want that selection range to have a background color of orange, and I also have a selected date range of December 11 to 17 and I want that selection range to have a background color of blue. Is this possible? Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
That is possible with custom day rendering. In order to use custom day rendering, you would handle the Calendar control's DayRender event. That event is called for every day cell. You can then render each day cell yourself based on whatever logic you may have. For example, render a red DIV for the first day, render a blue DIV for the second day, etc.
Hope this helps. Please feel free to let us know if you have any more questions.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 4/9/2010 Posts: 12
|
Thanks for this.. could you provide a code sample as to how i render a day cell DIV myself?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You can take a look Demos -> Calendar -> Programming -> Editable Scheduler in the sample project for a working example of this feature. The full source of the sample project is in your installation folder when you install our controls.
The basic idea is you "write" anything you want into each cell. So for example, if you have something like this in your DayRender event handler:
e.Writer.Write("<div style='width:20px;height:20px;background-color:red;'></div>");
When this is called on every day cell by the Calendar, you get a 20 by 20 red square in every cell.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 4/9/2010 Posts: 12
|
eo_support.. you are a blinding brilliant light from heaven. thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Glad to hear that. : ) Feel free to let us know if there is anything else.
|
|