I have set a Shared Calendar and have disabled the dates in the calendar popup by setting the RangeMinDate and RangeMinDate; however, I would like to set the MinDate and MaxDate properties of the End By RadDatePicker so that the User is prevented from entering a date outside of the required date range and is provided a visual clue that there is an error, as I have implemented in the RadDatePickers that determine the duration.
Is this possible?
Thanks,
Al
4 Answers, 1 is accepted
This is a breaking change in the Q2 release that we've introduced unintentionally.
Since version 2010.1.415 we've separated the recurring settings from the Advanced Form by using a RecurrenceEditor control for easier customization.To be able to find the "End By" RadDatePicker you need to subcribe to the OnFormCreated event and find the RecurrenceEditor first. Here's the code for this:
protected
void
RadScheduler1_FormCreated(
object
sender, SchedulerFormCreatedEventArgs e)
{
if
(e.Container.Mode == SchedulerFormMode.AdvancedInsert)
{
RecurrenceEditor editor = (RecurrenceEditor)e.Container.FindControl(
"RecurrenceEditor"
);
RadDatePicker datePicker = (RadDatePicker)editor.FindControl(
"RangeEndDate"
);
datePicker.MinDate = DateTime.Parse(
"8/1/2010"
);
datePicker.MaxDate = DateTime.Parse(
"8/21/2010"
);
}
}
Hope this helps.
Best regards,
Veronica Milcheva
the Telerik team
Hi,
I am trying to set End By Date in Advance Edit mode but not working, Please guide me how to achieve this. Thanks
Code:
else if (e.Container.Mode == SchedulerFormMode.AdvancedEdit)
{
//Default the End By date to the Order Service End Date
RecurrenceEditor editor = (RecurrenceEditor)e.Container.FindControl("RecurrenceEditor");
RadDatePicker endBy = (RadDatePicker)editor.FindControl("RangeEndDate");
if (endBy != null)
{
// endBy.SelectedDate = GetOrderServiceEndDate();
endBy.SelectedDate = new DateTime(2018,03,20);
}
}
Recurrence Rule:
DTSTART:20180312T190000Z
DTEND:20180313T070000Z
RRULE:FREQ=DAILY;UNTIL=20180321T000000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR,SA,SU
EXDATE:20180320T190000Z
I have just answered you support ticket on the matter, for convenience I am pasting my answer here as well:
Tha RadDatePicker control inside the AdvacedEdit form of the Scheduler has an ID="EndDate". Changing it will allow you to set the target end date successfully:
protected
void
RadScheduler1_FormCreated(
object
sender, SchedulerFormCreatedEventArgs e)
{
if
(e.Container.Mode == SchedulerFormMode.AdvancedEdit)
{
RecurrenceEditor editor = (RecurrenceEditor)e.Container.FindControl(
"RecurrenceEditor"
);
RadDatePicker endBy = (RadDatePicker)editor.FindControl(
"EndDate"
);
if
(endBy !=
null
)
{
endBy.SelectedDate =
new
DateTime(2018, 03, 20);
}
}
}
You can dinf details on the matter here:
https://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/how-to/change-the-end-date-when-the-start-date-changes
Regards,
Vessy
Progress Telerik