Unplanned
Last Updated: 24 Aug 2018 12:55 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 20 Aug 2018 08:15
Category: Scheduler/Reminder
Type: Bug Report
1
FIX. RadScheduler - RangeStartDate/RangeEndDate doesn't limit the navigation in SchedulerMonthView
To reproduce:

            this.radScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Month;

            SchedulerMonthView monthView = this.radScheduler1.GetMonthView();
            DateTime start= new DateTime(2018, 8, 1);
            DateTime end= new DateTime(2018,8,31);
            monthView.ShowFullMonth = true;
            monthView.StartDate=start;
            monthView.RangeStartDate = start;
            monthView.RangeEndDate = end;

You will notice that you can navigate outside the specified range.

Workaround: manipulate the start date of the view:
this.radScheduler1.ActiveView.PropertyChanged += ActiveView_PropertyChanged;

        DateTime start = new DateTime(2018, 8, 1);
        DateTime end = new DateTime(2018,8,31);

        private void ActiveView_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "StartDate" && (this.radScheduler1.ActiveView.StartDate < start || start.AddDays(30) < this.radScheduler1.ActiveView.StartDate) 
                || e.PropertyName == "WeekCount" && this.radScheduler1.ActiveView.EndDate > end)
            {
                this.radScheduler1.ActiveView.StartDate = start;
            }
        }
0 comments