I have been following the documentation from http://help.infragistics.com/Help/Doc/WPF/2015.1/CLR4.0/html/xamSchedule_Using_Activities_Recurrent.html#Example_CS on how to create recurrent activities.
I haven't found any examples on how to create custom monthly activities.
Say for example I have these parameters:
Parameter 1: First, Second, Third, Forth, Last
Parameter 2: day, weekday, weekday day, Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
How would I create a recurrence for:
or
TIA
Hello,
I am really glad, I could help out. If you do not have any further questions, please verify this thread as answered, so it helps other users as well.
Thanks, Teodor Software Developer Infragistics www.infragistics.com/support
Thanks worked like a charm
Hi reggie,
Thank you for your post. You can create custom monthly recurrences like this:
DateRecurrence rec = new DateRecurrence(); rec.Count = 10; rec.Frequency = DateRecurrenceFrequency.Monthly; rec.Interval = 1; var recuRules = new List<DateRecurrenceRuleBase>(); rec.Rules.Add(new DayOfWeekRecurrenceRule(DayOfWeek.Monday, 0)); rec.Rules.Add(new DayOfWeekRecurrenceRule(DayOfWeek.Tuesday, 0)); rec.Rules.Add(new DayOfWeekRecurrenceRule(DayOfWeek.Wednesday, 0)); rec.Rules.Add(new DayOfWeekRecurrenceRule(DayOfWeek.Thursday, 0)); rec.Rules.Add(new DayOfWeekRecurrenceRule(DayOfWeek.Friday, 0)); rec.Rules.Add(new DayOfWeekRecurrenceRule(DayOfWeek.Saturday, 0)); rec.Rules.Add(new DayOfWeekRecurrenceRule(DayOfWeek.Sunday, 0)); rec.Rules.Add(new SubsetRecurrenceRule { OccurrenceInstance = -1 }); myReccAppointment.Recurrence = rec;
Parameter 1: First, Second, Thirds, Fourth, Last is determined from the SubsetReccurenceRule's OccurenceInstance. Valid values are 1 to 366 and -366 to -1 where negative values indicate nth to the last.
Parameter 2: day, weekday, ....etc is determined from the DayOfWeekReccurenceRule's DayOfWeek that you are adding. For instance the provided sample demonstrates a Monthly recurrence Last Day every 1 month. You can review the attached sample as well and if you have any questions do not hesitate to ask.
Thanks, TeodorSoftware Developerwww.infragistics.com