This project is read-only.

Bug in Month view of the outlook calendar


Can you please help me resolve the below two bugs:
i) On click of Month button, there is error on day selection.
Today is 6th Sept, Thursday. But, the day selected is Friday. Screen shot attached <Bug1>
ii) Clicking on Friday in month view is taking me to Thursday in Day View, the previous day. This applies to all other days. for e.g.: click on Wednesday in month view navigates to Tuesday in Day view. Screen shot attached. <Bug2>

file attachments


rabisonrajbhandar wrote Sep 6, 2012 at 9:48 AM

Attaching Bug2

Eswaramoorthi wrote Oct 9, 2012 at 3:13 PM


I created the Appointments from Day View/ any view but it didn't reflected in the Week view and the Appointment item is saved in the AppointmentsOptions.xml.

As mentioned by Narat in the other Thread the calculation of X values done in ArrangeOverride() function in AppointmentItemsPanel.cs is giving the size which is out of visible area, due to which the Appointments are not displayed in the Week View except the First Day of the Week i.e. either Sunday/Monday.

The above code i Checked and didn't resolve the issue.

So i took the X values calculation from AppointmentItemsExtPanel.cs and it solved the issue and now the Week View is working fine.

Solution :

ArrangeOverride() in AppointmentItemsPanel.cs has been modified like below

protected override Size ArrangeOverride(Size finalSize)


for (int i = 0; i < this.Children.Count; i++)


double y = 0;

double x = 0;

Size ChildSize = new Size();

UIElement child = (UIElement)this.Children[i];

if (child.GetType() == typeof(ucAppointment))


ucAppointment item = (ucAppointment)child;

int count = 1;

int position = 0;

CalculateItemsInSlot(item, out count, out position);

ChildSize = CalculateHeightWidth(finalSize, (AppointmentVM)item.DataContext, count);

x = CalendarViewModel.TimeSlotWidth;

switch (CalendarViewModel.CurrentDateView)


case DateView.Day:

x += ChildSize.Width * position;


case DateView.WorkWeek:

case DateView.FullWeek:

  • Modified Start - Copy the X value Calculation from AppointmentItemsExtPanel.cs
    • Copy the CalculateX() function also from AppointmentItemsExtPanel.cs

// x += CalculateX((AppointmentVM)item.DataContext, finalSize.Width, count, position);

x += CalculateX((AppointmentVM)item.DataContext, finalSize.Width);

/Modified End - Copy the X value Calculation from AppointmentItemsExtPanel.cs /



y = CalculateY((AppointmentVM)item.DataContext);


child.Arrange(new Rect(x, y, ChildSize.Width, ChildSize.Height));


return base.ArrangeOverride(finalSize);


CalculateX() has been copied as it is from AppointmentItemsExtPanel.cs.

private double CalculateX(AppointmentVM vm, double width)


DateTime _MondaysDate = CalendarViewModel.CurrentDate.AddDays((int)System.DayOfWeek.Monday - (int)CalendarViewModel.CurrentDate.DayOfWeek);

long DateDiff = FunctionExtensions.DateDiff(DateInterval.Day, _MondaysDate.Date, vm.StartDate.Date);

if (CalendarViewModel.CurrentDateView == DateView.FullWeek)

DateDiff += 1;

return (double)DateDiff * CalendarViewModel.DayItemWidth;


I hope this helps.

wrote Feb 14, 2013 at 3:16 AM