Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
Simple day view navigation gives wrong dates
posted

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);
}

Parents
  • 49378
    posted

    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.

Reply Children