I am trying to clear the appointments for the current month in DayViewControl but it seems that i can't do it. I am able to clear the appointments for active day using
UltraCalendarInfo.ActiveDay.Appointments.Clear()
Is there any possible way to clear the appointments for current/active month?
Thanks,
Thankls Brian--
I have solved my probelm by calling following method of UltracalendarInfo.
GetAppointmentsInRange(StartDate, EndDate).Clear()
I have a problem with Ultradayview.
I have appointments displayed on the Ultradayview. I allow the user to configure the appointment with a dialog box where they select the color for the appointment. After the user closes the dialog box, I need to redraw the current day, because the appointment color may have changed.
I am attempting to redraw the Ultradayview by the following logic:
1) Remove all Appointments
2) Remove all Owners
3) Re-add all Owners
4) Re-add all Appointments
When I do this series of steps, the Ultradayview still displays the old Appointments with the old colors, even though I have cleared all the Appointments and Owners and re-added them! There appears to be a caching mechanism I'm running up against.
The specific steps in the code that I call when I want to redraw are:
calendarInfo.ActiveDay = calendarInfo.GetDay(CurrentDate, true); // CurrentDate is "today", and it is the same day that was already showing on the UltraDayView
calendarInfo.Owners.Clear();
(in a loop)
calendarInfo.Owners.Add(...);
(end loop)
calendarInfo.Appointments.Clear();
calendarInfo.Appointments.Add(...); // the appointments are re-added with different colors here
So, after I do this, it appears to do "nothing". If I manually change days to another day, then come back to the current day, then the Appointments correctly draw in the udpated colors. So something is "totally" clearing out the Appointments when I switch days. I want to "totally" clear out the appointments manually instead of having to switch days to get the Appointments to redraw.
I am using Infragistics version 7.1 library in C#. Thanks in advance for any help you can provide.
Some other approaches I have tried, that don't work, are:
GetAppointmentsInRange(StartDate, EndDate).Clear();
calendarInfo.Reset();
calendarInfo.ResetActiveDay();
UltraDayView.Refresh();