This is a migrated thread and some comments may be shown as answers.

Update EndDateTime when StartDateTime is updated for RadDateTimePicker

2 Answers 64 Views
Input
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 11 Aug 2011, 02:48 PM
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 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 16 Aug 2011, 12:12 PM
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.

0
Mark
Top achievements
Rank 1
answered on 17 Aug 2011, 03:21 PM
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.
Tags
Input
Asked by
Mark
Top achievements
Rank 1
Answers by
Mira
Telerik team
Mark
Top achievements
Rank 1
Share this question
or