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

RecurrenceRuleParent missing from Advanced Templates example?

5 Answers 82 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ramie C
Top achievements
Rank 1
Ramie C asked on 13 Apr 2010, 06:39 PM
I am curious as to how the DataRecurrenceParentKeyField is set in the advanced template example <here>. I am trying to replicate the example but am having a hard time figuring out how the parent key field gets set seeing as I keep getting an exception when trying to delete one ocurrence of a recurring event for example. Is there something perhaps I am missing, could someone help point me in the right direction?

Thanks

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 14 Apr 2010, 09:10 AM
Hello Ramie,

The advanced template example uses a provider and the Data* properties are not used. Can you, please, clarify your scenario?

Kind regards,
Tsvetomir Tsonev
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
Ramie C
Top achievements
Rank 1
answered on 19 Apr 2010, 07:20 PM
Well to explain the problem I am encountering I am using something similar to http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx I have a DefaultCS.aspx a DefaultCS.aspx.cs an AdvancedFormCS.ascx and an AdvancedFormCS.ascx.cs except I am using an entity data source.

The problem I actually have is that upon editing I am using a function called RadScheduler1_AppointmentUpdate:
        protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e) 
        { 
            var schedule = (AdvancedFormCS)editForm.FindControl("AdvancedFormCS1"); 
             
            var x = schedule.RecurrenceRuleText; 
 
            EntityDataSource1.UpdateParameters["Name"].DefaultValue = schedule.Subject; 
            EntityDataSource1.UpdateParameters["Description"].DefaultValue = schedule.Description; 
            EntityDataSource1.UpdateParameters["StartTime"].DefaultValue = schedule.Start.ToString(); 
            EntityDataSource1.UpdateParameters["EndTime"].DefaultValue = schedule.End.ToString(); 
            EntityDataSource1.UpdateParameters["PublishAt"].DefaultValue = schedule.PublishAt.ToString(); 
            EntityDataSource1.UpdateParameters["RemoveAt"].DefaultValue = schedule.RemoveAt.ToString(); 
            EntityDataSource1.UpdateParameters["RecurrenceRule"].DefaultValue = schedule.RecurrenceRuleText;          
          
        } 

and under my <AdvancedEditTemplate> i have:
<uc1:AdvancedFormCS ID="AdvancedFormCS1" runat="server" Subject='<%# Bind("Subject") %>' 
                Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'                 
                RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' /> 

As you can see under the "RecurrenceRule" I am encountering a problem seeing as I also need to set a RecurrenceRuleParent but the example does not provide me with a solution to this problem because it only gives me "RecurrenceRuleText" which I am assuming is only similar to "RecurrenceRule" from the other examples on the telerik website.

I am wondering how I should handle the recurrenceruleparent problem because it is needed if I wish to edit a single occurrence from an event that recurs.

Thanks

Ramie


0
T. Tsonev
Telerik team
answered on 21 Apr 2010, 01:49 PM
Hi Ramie,

I see what you mean now, thank you for the detailed explanation. You are free to access the form as you do in your code, but a more convenient way is to read the modified fields from the e.ModifiedAppointment property.

protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
 
    EntityDataSource1.UpdateParameters["Name"].DefaultValue = e.ModifiedAppointment.Subject;
    EntityDataSource1.UpdateParameters["Description"].DefaultValue = e.ModifiedAppointment.Description;
    EntityDataSource1.UpdateParameters["StartTime"].DefaultValue = e.ModifiedAppointment.Start.ToString();
    EntityDataSource1.UpdateParameters["EndTime"].DefaultValue = e.ModifiedAppointment.End.ToString();
    EntityDataSource1.UpdateParameters["PublishAt"].DefaultValue = e.ModifiedAppointment.Attributes["PublishAt"].ToString();
    EntityDataSource1.UpdateParameters["RemoveAt"].DefaultValue = e.ModifiedAppointment.Attributes["RemoveAt"].ToString();
    EntityDataSource1.UpdateParameters["RecurrenceRule"].DefaultValue = e.ModifiedAppointment.RecurrenceRule;         
    EntityDataSource1.UpdateParameters["RecurrenceParenrID"].DefaultValue = e.ModifiedAppointment.RecurrenceParentID;         
   
}

The RecurrenceParentID property is available there us well. I hope this helps

Greetings,
Tsvetomir Tsonev
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
Ramie C
Top achievements
Rank 1
answered on 21 Apr 2010, 02:42 PM
Although this has been a different way to view this, my RecurrenceParentID is showing up as a null when attempting to change only one occurence from a recurring appointment. I am wondering if there is perhaps something else I am missing. In my RadScheduler1_AppointmentInsert I do not have anything set for the RecurrenceParentID, do you see something that I should fix?
protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e) 
        { 
            // ToDo: Still does not allow use of RecurrenceRuleParent 
            var schedule = (PopUpUserControl)insertForm.FindControl("PopUpUserControl1"); 
            EntityDataSource1.InsertParameters["Name"].DefaultValue = schedule.Subject; 
            EntityDataSource1.InsertParameters["Description"].DefaultValue = schedule.Description; 
            EntityDataSource1.InsertParameters["StartTime"].DefaultValue = schedule.Start.ToString(); 
            EntityDataSource1.InsertParameters["EndTime"].DefaultValue = schedule.End.ToString(); 
            EntityDataSource1.InsertParameters["PublishAt"].DefaultValue = schedule.PublishAt.ToString(); 
            EntityDataSource1.InsertParameters["RemoveAt"].DefaultValue = schedule.RemoveAt.ToString(); 
            EntityDataSource1.InsertParameters["RecurrenceRule"].DefaultValue = schedule.RecurrenceRuleText; 
        } 

If not, do you have any other recommendations? Thanks for the help so far.
0
T. Tsonev
Telerik team
answered on 23 Apr 2010, 03:07 PM
Hi Ramie,

You should store the RecurrenceParentID when inserting appointment it as well. You can access it through e.Appointment.RecurrenceParentID. Same goes for the other fields as well.

I hope this helps.

Regards,
Tsvetomir Tsonev
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.
Tags
Scheduler
Asked by
Ramie C
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Ramie C
Top achievements
Rank 1
Share this question
or