Updating EndDate when StartDate doesn't work

2 posts, 0 answers
  1. Erminio
    Erminio avatar
    3 posts
    Member since:
    May 2017

    Posted 22 Feb 2018 Link to this post

    Hi all,

    I'm updating EndDate value when StartDate value changes. This seems to work fine, but when I try to save the appointment the old date value appears in the EndDatePicker and I cannot save the appointment.

     

    Here is mycode

     

    JavaScript

    function changeEndDate(sender, e) {
     var endDatePickerID = sender.get_id().replace("StartDate", "EndDate");
     var endDatePicker = $find(endDatePickerID);
     endDatePicker.set_selectedDate(sender.get_selectedDate());
    }

     

    c#

    RadDatePicker startDate = (RadDatePicker)e.Container.FindControl("StartDate");
    if (startDate != null){
    startDate.ClientEvents.OnDateSelected = "changeEndDate"
    }

     

    Can 

     

    The code is copied from this link https://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/how-to/change-the-end-date-when-the-start-date-changes

     

    Any help on this?
    Thanks a lot

  2. Peter Milchev
    Admin
    Peter Milchev avatar
    464 posts

    Posted 27 Feb 2018 Link to this post

    Hello Erminio,

    The return of the old value is unexpected and it might be related to some customizations. 

    Please find attached a sample project and a screencast demonstrating the proper behavior of the code suggested in the provided article. 

    If that does not help to resolve the issue, please modify the attached project and send it back to us as an attachment in an official support ticket for further investigation.

    Regards,
    Peter Milchev
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top