Holidays in Calendar |
Post Reply |
Author | |
HansN
Newbie Joined: 06 August 2007 Location: Austria Status: Offline Points: 7 |
Post Options
Thanks(0)
Posted: 14 November 2007 at 3:50am |
Hello !
In the Calendar sample application it is shown how easy it is to create recurrent events. I would like to adapt the Calendar to take holidays into account. This means to include holidays into the recurrence, e.g. this event happens on Sundyas and holidays within 30 days, and to exclude holidays from the recurrence, e.g. this event happens within 30 days, but not on holidays. The holidays will be predefined in a collection. Unfortunatly I did not find a way to adapt the recurrence pattern or to control the generation of recurrences that way. Does anybody have an idea how to do that ? Thanks in advance HansN |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi,
You can create a regular daily pattern for 30 days, and handle PrePopulate event. There you can verify whether a current day for an occurrence does exists in your holidays' collection, and remove it if necessary. -- WBR, Serge |
|
HansN
Newbie Joined: 06 August 2007 Location: Austria Status: Offline Points: 7 |
Post Options
Thanks(0)
|
Thanks for the tip.
I implemented it that way and it worked fine. But the datepicker control did not checked that there were no events any more, so I used the DayMetrics event of datepicker to change color of holidays to red. I also changed the header color of holidays to red in day, week and month view and it worked fine. There is still the problem that I need to add holidays events to the occurrence. Is there a chance to get the calculated end time of an occurence ? If I have start and end time I can check for holidays in that time range and add some new events. Of course I will "link" them to the master event by a custom property, e.g. by saving the event IDs in a list. WBR, HansN |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |