RecurrenceEditor Reset on PostBack

4 posts, 1 answers
  1. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 27 Jun 2014 Link to this post

    I have some oddities in the RecurrenceEditor retaining it's selected values.

    The editor is part of a templated edit form. On that form, there is a control that causes postback. There are a couple instances in which certain items on the RecurrenceEditor are reset on postback.

    In my examples, () denote items the user selects. If it remains in the second part of my scenario, the selected item stays selected. Otherwise, I will state to what it resets.

    Yearly - Every (Month)(Day), resets to Every January 1
    Monthly - Day (Day) of every (#) Months, resets to Day 1 of every (#) Months

    In all other scenarios, the selected items remain correctly selected.

    Thanks,
    Kerry Wano

     

  2. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 01 Jul 2014 Link to this post

    Hello Kerry,

    The scenario looks quite custom and it is not quite clear how to replicate it at our side. Would you please provide a little bit more information that will help us observe it at our side so we could inspect it and be more helpful?

    Regards,
    Plamen
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kerry
    Kerry avatar
    25 posts
    Member since:
    Jun 2013

    Posted 02 Jul 2014 in reply to Plamen Link to this post

    I'll simplify the example, but I have a RecurrenceEditor and another control within an UpdatePanel.

    <EditFormSettings EditFormType="Template">
        <FormTemplate>
            <asp:UpdatePanel ID="pnlEditForm" runat="server">
                <ContentTemplate>
                    <telerik:RadSchedulerRecurrenceEditor ID="schFrequency" runat="server" Width="600px" />
                    <br />
                    <uc:DropDownList ID="ddlTaskType" runat="server" AutoPostBack="true" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </FormTemplate>
    </EditFormSettings>

    I've stripped out a lot of other controls within the UpdatePanel, but the DropDownList causes changes in some of those other controls on postback. 

    The issue arises based upon what I have selected in the RecurrenceEditor. First, if I have Yearly selected and I select Every July 10, on postback, the selections reset to Yearly, Every January 1. The month and day reset to defaults. Second, if I have Monthly selected and Day 10 of every 2 Months, the selections reset to Monthly, Day 1 of every 2 Months. The day resets to default. Does that make sense?
  5. Answer
    Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 07 Jul 2014 Link to this post

    Hello Kerry,

    Thank you for elaborating the issue. 

    You can persist the rule in the Editor by using the code below:
    protected void ddlTaskType_SelectedIndexChanged(object sender, DropDownListEventArgs e)
      {
          schFrequency.RecurrenceRule = schFrequency.RecurrenceRule;
      }
    <telerik:RadDropDownList ID="ddlTaskType" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlTaskType_SelectedIndexChanged" >
                        <Items>
                             <telerik:DropDownListItem Text="first" />
                             <telerik:DropDownListItem Text="second" />
                             <telerik:DropDownListItem Text="third" />
                             <telerik:DropDownListItem Text="forth" />
     
                        </Items>
                    </telerik:RadDropDownList>

    The unusual behavior is most probably connected with the fact the RecurrenceEditor is mostly used in RadScheduler and is sometimes deliberately reset to initial settings.

    Hope this will help you solve the issue.

    Regards,
    Plamen
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top