diff --git a/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs b/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs index 0b62ec3..aa1f44b 100644 --- a/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs +++ b/Controls/Input/Input.UWP/Calendar/View/RadCalendar.cs @@ -3069,20 +3069,33 @@ namespace Telerik.UI.Xaml.Controls.Input this.defaultHighlightedCellStyle = (CalendarCellStyle)RadCalendar.MultiDayViewResources[DefaultHighlightedCellStyleName]; } } - } - - private void FetchNewAppointments() - { - if (this.AppointmentSource != null && this.IsTemplateApplied) - { - DateTime startDate = GetFirstDayofMonth(this.DisplayDate, this.currentCulture.Calendar); - ObservableCollection fetchedAppointments = this.AppointmentSource.FetchData(startDate, startDate.Month == DateTime.MaxValue.Month && startDate.Year == DateTime.MaxValue.Year ? startDate : startDate.AddMonths(1)); - this.AppointmentSource.AllAppointments.Clear(); - foreach (IAppointment app in fetchedAppointments) - { - this.AppointmentSource.AllAppointments.Add(app); - } - } + } + + private void FetchNewAppointments() + { + if (this.AppointmentSource != null) + { + var rowCount = this.model.RowCount; + int columnCount; + if (this.DisplayMode == CalendarDisplayMode.MultiDayView) + { + columnCount = 3 * this.MultiDayViewSettings.VisibleDays; + } + else + { + columnCount = this.model.ColumnCount; + } + + DateTime startDate = this.model.GetFirstDateToRenderForDisplayMode(this.DisplayDate, this.DisplayMode); + DateTime endDate = startDate.AddDays(rowCount * columnCount); + + ObservableCollection fetchedAppointments = this.AppointmentSource.FetchData(startDate, startDate.Month == DateTime.MaxValue.Month && startDate.Year == DateTime.MaxValue.Year ? startDate : endDate); + this.AppointmentSource.AllAppointments.Clear(); + foreach (IAppointment app in fetchedAppointments) + { + this.AppointmentSource.AllAppointments.Add(app); + } + } } private void AddLayer(CalendarLayer layer, Panel parent)