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

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

1 Answer 114 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Dmitri
Top achievements
Rank 1
Dmitri asked on 19 Jan 2012, 05:45 PM
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>
                    <Columns>
                        <telerik:TreeListBoundColumn DataField="ID" UniqueName="column" Visible="False">
                        </telerik:TreeListBoundColumn>
                        <telerik:TreeListBoundColumn DataField="ID_Parent" UniqueName="column1" Visible="False">
                        </telerik:TreeListBoundColumn>
                        <telerik:TreeListTemplateColumn DataField="Display" HeaderText="Content" UniqueName="col_Display">
                            <ItemTemplate>
                                <asp:Label ID="lblCDisplay" runat="server" Text='<%# Eval("Display") %>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadTextBox runat="server" ID="rtb_CDisplay" Skin="Office2010Blue" Text='<%# Bind("Display") %>' Width="100%" Height="40px" TextMode="MultiLine" />
                            </EditItemTemplate>
                        </telerik:TreeListTemplateColumn>
                        <telerik:TreeListTemplateColumn DataField="Type" HeaderText="" UniqueName="col_Type">
                            <ItemTemplate>
                                <asp:Label ID="lblCType" runat="server" Text='<%# Eval("Type") %>' />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadComboBox runat="server" ID="rcb_CType" Skin="Office2010Blue" SelectedValue='<%# Bind("Type") %>' DataSource='<%# (new string[] {"Team Lead", "EDA"}) %>' Width="100%" />
                            </EditItemTemplate>
                            <ItemStyle Width="75px" HorizontalAlign="Center" />
                            <HeaderStyle Width="75px" HorizontalAlign="Center" />
                        </telerik:TreeListTemplateColumn>
                        <telerik:TreeListEditCommandColumn UniqueName="EditColumn" ButtonType="LinkButton" ShowAddButton="true" HeaderText="">
                            <ItemStyle HorizontalAlign="Center" Width="100px" />
                            <HeaderStyle HorizontalAlign="Center" Width="100px" />
                        </telerik:TreeListEditCommandColumn>
                        <telerik:TreeListButtonColumn UniqueName="DeleteColumn" ButtonType="LinkButton" HeaderText="" CommandName="Delete" Text="Delete">
                            <ItemStyle HorizontalAlign="Center" Width="50px" />
                            <HeaderStyle Width="50px" />
                        </telerik:TreeListButtonColumn>
                    </Columns>
                </telerik:RadTreeList>

Not sure if it makes a difference but the whole thing is inside a RadPageView

1 Answer, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 24 Jan 2012, 03:41 PM
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.

Greetings,
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
Tags
TreeList
Asked by
Dmitri
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Share this question
or