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

[Solved] Change End Date

1 Answer 93 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Aditya
Top achievements
Rank 1
Aditya asked on 03 Jul 2009, 11:52 AM
Hi All,
         Is there anyway to change the end date programmatically or through a setting when the user changes the start date ? So far example the user changes the start date to 7/4/2009 I want to be able to set the end date to also 7/4/2009 as against 7/3/2009 which is being done right now. 

Thanks,
Aditya

1 Answer, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 08 Jul 2009, 03:27 PM
Hi Aditya ,

Yes, this is possible. Here is how:

1. Subscribe to the OnFormCreated event and find the RadDatePicker object. Then subscribe to its OnDateSelected event:

protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e) 
    RadDatePicker startDate = e.Container.FindControl("StartDate"as RadDatePicker; 
    startDate.ClientEvents.OnDateSelected = "changeEndDate"


2. Define the changeEndDate javascript method as follows:

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"
<script type="text/javascript"
function changeEndDate(sender, e) 
    var endDatePickerID = sender.get_id().replace("StartDate""EndDate"); 
    var endDatePicker = $find(endDatePickerID); 
    endDatePicker.set_selectedDate(sender.get_selectedDate()); 
</script> 
</telerik:RadScriptBlock> 

I hope this helps.

All the best,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Aditya
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or