"Failed to load viewstate" error when updating/canceling an inplace edit

2 posts, 0 answers
  1. Dmitri
    Dmitri avatar
    12 posts
    Member since:
    May 2011

    Posted 19 Jan 2012 Link to this post

    I have a TreeList object that allows inplace editing. Two of the columns are TemplateColumns that display using a label but edit using a RadComboBox. When I press the edit button everything works fine (my drop downs load and everything) but when i press Cancel or Update after editing the system throws a "Failed to load viewstate" error. Treelist code below:

                    <telerik:RadTreeList ID="rtl_Content" runat="server" 
                        AutoGenerateColumns="False" DataKeyNames="ID" ParentDataKeyNames="ID_Parent" Skin="Office2010Blue" EditMode="InPlace">
                        <ExportSettings ExportMode="RemoveControls"><Pdf PageHeight="11in" PageWidth="8.5in"></Pdf></ExportSettings>
                            <telerik:TreeListBoundColumn DataField="ID" UniqueName="column" Visible="False">
                            <telerik:TreeListBoundColumn DataField="ID_Parent" UniqueName="column1" Visible="False">
                            <telerik:TreeListTemplateColumn DataField="Display" HeaderText="Content" UniqueName="col_Display">
                                    <asp:Label ID="lblCDisplay" runat="server" Text='<%# Eval("Display") %>' />
                                    <telerik:RadTextBox runat="server" ID="rtb_CDisplay" Skin="Office2010Blue" Text='<%# Bind("Display") %>' Width="100%" Height="40px" TextMode="MultiLine" />
                            <telerik:TreeListTemplateColumn DataField="Type" HeaderText="" UniqueName="col_Type">
                                    <asp:Label ID="lblCType" runat="server" Text='<%# Eval("Type") %>' />
                                    <telerik:RadComboBox runat="server" ID="rcb_CType" Skin="Office2010Blue" SelectedValue='<%# Bind("Type") %>' DataSource='<%# (new string[] {"Team Lead", "EDA"}) %>' Width="100%" />
                                <ItemStyle Width="75px" HorizontalAlign="Center" />
                                <HeaderStyle Width="75px" HorizontalAlign="Center" />
                            <telerik:TreeListEditCommandColumn UniqueName="EditColumn" ButtonType="LinkButton" ShowAddButton="true" HeaderText="">
                                <ItemStyle HorizontalAlign="Center" Width="100px" />
                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                            <telerik:TreeListButtonColumn UniqueName="DeleteColumn" ButtonType="LinkButton" HeaderText="" CommandName="Delete" Text="Delete">
                                <ItemStyle HorizontalAlign="Center" Width="50px" />
                                <HeaderStyle Width="50px" />

    Not sure if it makes a difference but the whole thing is inside a RadPageView
  2. Antonio Stoilkov
    Antonio Stoilkov avatar
    530 posts

    Posted 24 Jan 2012 Link to this post

    Hi Dmitri,

    I tried to replicate the issue which you described, but to no avail. Attached to this message, you will find the code which I used for testing. Please, take a look at it and let me know if there are any differences at your end, which I may be leaving out.

    Note that failed Viewstate load could be caused by dynamically adding controls in Page_Load method. It is more likely that server-side code causes the issue and not the declaration of the controls.

    Antonio Stoilkov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. DevCraft R3 2016 release webinar banner
Back to Top