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

Recurrence Editor & "End By" RadDatePicker

4 Answers 99 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alvin Taylor
Top achievements
Rank 1
Alvin Taylor asked on 05 Aug 2010, 06:54 PM
I have a requirement that the user should not be able to set the End By date outside of a specific date range.  i.e. The user can not set the End By date to 8/30/2010 when the required date range is 8/1/2010 to 8/21/2010.

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

Sort by
0
Veronica
Telerik team
answered on 06 Aug 2010, 01:23 PM
Hello Alvin Taylor,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Alvin Taylor
Top achievements
Rank 1
answered on 06 Aug 2010, 04:20 PM
Thank you.  I will upgrade to the Q2 release.
0
Venkat
Top achievements
Rank 1
answered on 12 Mar 2018, 07:54 PM

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

 

0
Vessy
Telerik team
answered on 14 Mar 2018, 09:03 AM
Hi Venkat,

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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Scheduler
Asked by
Alvin Taylor
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Alvin Taylor
Top achievements
Rank 1
Venkat
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or