Recurrence Editor & "End By" RadDatePicker

5 posts, 0 answers
  1. Alvin Taylor
    Alvin Taylor avatar
    3 posts
    Member since:
    Mar 2006

    Posted 05 Aug 2010 Link to this post

    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
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 06 Aug 2010 Link to this post

    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
  3. Alvin Taylor
    Alvin Taylor avatar
    3 posts
    Member since:
    Mar 2006

    Posted 06 Aug 2010 Link to this post

    Thank you.  I will upgrade to the Q2 release.
  4. Venkat
    Venkat avatar
    1 posts
    Member since:
    Apr 2017

    Posted 12 Mar 2018 in reply to Veronica Link to this post

    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

     

  5. Vessy
    Admin
    Vessy avatar
    1870 posts

    Posted 14 Mar 2018 Link to this post

    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.
Back to Top