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

CustomAttributeNames breaks Updates

1 Answer 88 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Tayonee
Top achievements
Rank 1
Tayonee asked on 12 Aug 2008, 03:26 PM
Whenever i use CustomAttributeNames I am unable to update.  I receive this message:

Sys.WebForms.PageRequestManagerServerErrorException: Error serializing value 'Telerik.Web.UI.Appointment' of type 'Telerik.Web.UI.Appointment.'

If i remove the custom attribute names everything works fine.  Here is a simple test i put together that causes the same issue. My real project actually uses the custom attributes to personalize each event with an image and backgroundcolor.

Any help would be greatly appreciated.

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
            <telerik:RadScheduler ID="RadScheduler1" runat="server"
            DataEndField="enddatetime" DataKeyField="ID"  DataSourceID="SqlDataSource1"
            DataStartField="startdatetime" DataSubjectField="subject" Height="593px" Width="1220px"
            WeekView-HeaderDateFormat="MMMM dd" WeekColumnHeaderDateFormat="ddd, dd"
            SelectedDate="2008-07-03" DayEndTime="19:00:00" CustomAttributeNames="ID"
            style="float:left" ShowAllDayRow="False"
            SelectedView="WeekView" StartInsertingInAdvancedForm="True"
            FirstDayOfWeek="Monday" LastDayOfWeek="Friday" WeekHeaderDateFormat="MMMM dd">
            </telerik:RadScheduler>
        </telerik:RadAjaxPanel>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:TesterSite %>"
            DeleteCommand="DELETE FROM [tblSimple] WHERE [ID] = @ID"
            InsertCommand="INSERT INTO [tblSimple] ([startdatetime], [enddatetime], [subject]) VALUES (@startdatetime, @enddatetime, @subject)"
            SelectCommand="SELECT * FROM [tblSimple]"
            UpdateCommand="UPDATE [tblSimple] SET [startdatetime] = @startdatetime, [enddatetime] = @enddatetime, [subject] = @subject WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="startdatetime" Type="DateTime" />
                <asp:Parameter Name="enddatetime" Type="DateTime" />
                <asp:Parameter Name="subject" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="startdatetime" Type="DateTime" />
                <asp:Parameter Name="enddatetime" Type="DateTime" />
                <asp:Parameter Name="subject" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>

1 Answer, 1 is accepted

Sort by
0
Tayonee
Top achievements
Rank 1
answered on 12 Aug 2008, 03:50 PM
Upon further testing with my other project I found the problem is caused by the ID field.  Changed the datasource to pull ID as IDTest and added IDTest to the customattributenames and everything works.
Tags
Scheduler
Asked by
Tayonee
Top achievements
Rank 1
Answers by
Tayonee
Top achievements
Rank 1
Share this question
or