I have this simple code checked this with 10.2 and 11.2 version both give wrong NewDate inside the events ( ActiveDayChanging and ActiveDayChanged events) when navigating dates (right left buttons).
WebDayView wdv = new WebDayView(); WebScheduleInfo wsi = new WebScheduleInfo(); WebDateChooser wdc = new WebDateChooser(); protected void Page_Load(object sender, EventArgs e) { wdc.ValueChanged += new WebDateChooser.ValueChangedEventHandler(wdc_ValueChanged); wsi.ActiveDayChanged += new ActiveDayChangedEventHandler(wsi_ActiveDayChanged); wsi.ActiveDayChanging += new ActiveDayChangingEventHandler(wsi_ActiveDayChanging); wdv.EnableKeyboardNavigation = true; wdv.NavigationButtonsVisible = true; wdv.WebScheduleInfo = wsi; wdc.AutoPostBack.ValueChanged = true; form1.Controls.Add(wdc); form1.Controls.Add(wdv); form1.Controls.Add(wsi); } void wsi_ActiveDayChanging(object sender, ActiveDayChangingEventArgs e) { } void wsi_ActiveDayChanged(object sender, ActiveDayChangedEventArgs e) { wdc.Value = e.NewDate.ToString(); } void wdc_ValueChanged(object sender, WebDateChooser.WebDateChooserEventArgs e) { wsi.ActiveDayUtc = new Infragistics.WebUI.Shared.SmartDate((DateTime)e.Value); }
Hi quantom,
Thank you for posting in the community.
After changing the day in WebDayView using the previous/next arrows, the Active day in WebScheduleInfo should be the day before the one shown in WebDayView after the navigation. If you wish the value of WebDateChooser to be the same as the one shown for WebDayView you should be able to use the following code:
WebDateChooser1.Value = e.NewDate.Value.AddDays(1);
Please let me know if this helps.
and that's only for next for previous would be -1, but may I know the logic for that behavior ?
After investigating this matter, it appears to be the default behavior with WebScheduleInfo's active day for all WebSchedule controls - WebDayView, WebMonthView etc - the ActiveDay is being set to 10 p.m. of the previous day. This seems to be done for internal calculation purposes.
Please let me know if you have any questions.
So basically when you use the arrows on webschedule controls to switch months... the active day becomes out of sync with the webscheduleinfo.