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

2 RadDateTimePicker controls

3 Answers 61 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ilya
Top achievements
Rank 1
Ilya asked on 12 Oct 2011, 02:50 PM
I have 2 RadDateTimePicker controls on the page and after user changes time on the first control I want to set another control to display time shown in 1st control (and plus 30 minutes). I've tried using <ClientEvents OnDateSelected="changeEndDate" /> and this javascript but it does not seem to work. Both controls are located inside of an AdvancedInsertTemplate of RadScheduler. 

function changeEndDate(sender, eventArgs) {
      var endDate = $telerik.$("[id$='EndInput']");
      var newDate = eventArgs.get_newValue();
      endDate.set_selectedDate(newDate);
}

What am I doing wrong? Thanks

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 17 Oct 2011, 09:43 AM
Hi Ilya,

Please try to use the following approach:
<script type="text/javascript">
    function DateSelected(sender, eventArgs) {
        var datetimepicker2 = $find("<%= RDTP2.ClientID %>");
        debugger;
        var date = sender.get_selectedDate();
        date.setMinutes(date.getMinutes() + 30);
        datetimepicker2.set_selectedDate(date);
 
    }
</script>
<telerik:RadDateTimePicker ID="RDTP1" runat="server">
    <ClientEvents OnDateSelected="DateSelected" />
</telerik:RadDateTimePicker>
<telerik:RadDateTimePicker ID="RDTP2" runat="server">
</telerik:RadDateTimePicker>

Give this a try and let me know if it helps.

Regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Ilya
Top achievements
Rank 1
answered on 17 Oct 2011, 03:14 PM
Hi Maria,

The problem is that both RadDateTimePickers are located inside of AdvancedEditTemplate of RadScheduler and I am having problems finding the EndInput (Appointment End field). I've used var endDate = $telerik.$("[id$='_EndInput']"); and still can't find it.
0
Maria Ilieva
Telerik team
answered on 20 Oct 2011, 09:50 AM
Hi Ilya,

Please try using the approaches provided in the following help topic to access the controls in the AdvancedEditTemplate and let me know if this helps.

Regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Calendar
Asked by
Ilya
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Ilya
Top achievements
Rank 1
Share this question
or