Update EndDateTime when StartDateTime is updated for RadDateTimePicker

3 posts, 0 answers
  1. Mark
    Mark avatar
    2 posts
    Member since:
    Jun 2010

    Posted 11 Aug 2011 Link to this post

    When my form is loaded I'm setting StartDate to now and EndDate to now+1 hour. I'd like to have the EndDate (month/time/year, not time) update whenever the StartDateTime is updated. This project is within Sitefinity.

    I've tried a few different methods but nothing seems to work out. My latest attempt:

    <telerik:RadDateTimePicker ID='dtEventBegin' runat='server'>
    <DateInput ClientEvents-OnBlur="changeEndDate" />
    </telerik:RadDateTimePicker>
     
    <telerik:RadDateTimePicker ID='dtEventEnd' runat='server' />
     
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            function changeEndDate(sender, e)
            {   
                var endDatePickerID = sender.get_id().replace("dtEventBegin", "dtEventEnd");   
                var endDatePicker = $find(endDatePickerID);   
                endDatePicker.set_selectedDate(sender.get_selectedDate());
            }
    </telerik:RadScriptBlock>

    I'm not finding very many usage scenarios for the DateTimePicker, can I please get some help?
  2. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 16 Aug 2011 Link to this post

    Hello Mark,

    I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.

    I hope it helps.

    Kind regards,
    Mira
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Mark
    Mark avatar
    2 posts
    Member since:
    Jun 2010

    Posted 17 Aug 2011 Link to this post

    Mira, that works exactly as I wanted. The only caveat is that it also makes the buttons for the Date & Time pickers disappear. Do you have any insight into why that would happen?

    Edit: Updating to latest tools fixed the problem.
Back to Top