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

Using advanced form control, Custom Attributes do not get serialized

1 Answer 95 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 22 Nov 2010, 09:58 PM
Hi,

I am trying to implement an advanced Edit/Insert form.  I used your example on this website from the demos.  I can set Custom Attibutes with no problem so that they appear on the form, but getting them to save in an insert or edit is not working.  When I change these values, I can see them in a Javascript Debugger correctly that the attributes are set with my new value. 

So, when I click the Advanced Form to save the changes and and in the _saveClicked handler, it calls this._scheduler.updateAppointment(apt), the appointment passed in "apt" has my custom attributes.  However, when it goes to do the postback, the appointment returned from this._getSerializableAppointment(j), does not have any Custom Attributes.  It appears they are not set.

So, when I try to access e.ModifiedAppointment.Attributes["MyAttibute"] from the below method
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)

It is never set with the updated value.

What I am missing? If I just add Custom Attributes to the scheduler 
and do not create a separate Advanced Form control, I can see the update value in 
e.ModifiedAppointment.Attributes["MyAttibute"].

Thanks in advance.  -John

        if (this._isInsert)
            this._scheduler.insertAppointment(apt);
        else
            his._scheduler.updateAppointment

        if (this._isInsert)
            this._scheduler.insertAppointment(apt);
        else
            this._scheduler.updateAppointment(apt);
        if (this._isInsert)
            this._scheduler.insertAppointment(apt);
        else
          
        if (this._isInsert)
            this._scheduler.insertAppointment(apt);
        else
            this._scheduler.updateAppointment(apt);
 t_scheduler.updateAppointment(ap

1 Answer, 1 is accepted

Sort by
0
Veronica
Telerik team
answered on 26 Nov 2010, 10:25 AM
Hi John,

Please accept my apologies for the late reply.

Have you set bindable property for the custom attribute in the code-behind of the Advanced Form? Here's an example:

[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
    public string MyAttribute
    {
        get
        {
            return MyAttribute.Text;
        }
  
        set
        {
            MyAttribute.Text = value;
        }
    }

Also make sure that you've set the property in the AdvancedInsert_  and AdvancedEditTemplate:

<AdvancedEditTemplate>
                <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>'
                    MyAttribute='<%# Bind("MyAttribute") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>'
                    RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' Reminder='<%# Bind("Reminder") %>'
                    AppointmentColor='<%# Bind("AppointmentColor") %>' UserID='<%# Bind("User") %>' />
</AdvancedEditTemplate>

If this doesn't help - can you please send me the full code so I can inspect it and help you?

Thank you!

All the best,
Veronica Milcheva
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Scheduler
Asked by
John
Top achievements
Rank 1
Answers by
Veronica
Telerik team
Share this question
or