Bit baffled here,..new one on me.
My Detail Grid Inserts fine,
If I go into edit mode, I can edit the record, and "Accept" it, ...fine...but, ...on "Cancel" to get outta edit mode,...I get this,...(and no Postback that i can see (well not at PageLoad event anyway.))
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
I have tried trimming most code behind out to see if that was causing it,...Problem persists.
(The code behind just shows selected vals from/in a dropdown, in Ins and Edit mode otherwise that selected val in a label of that col.
And, ...I do not add any controls dynamically, nor move them about...
Thanks Neal
Markup is as follows:
<telerik:RadGrid ID="GrvTask" runat="server"
AutoGenerateColumns="False"
AllowAutomaticUpdates="False"
AllowAutomaticDeletes="False"
AllowAutomaticInserts="False"
AllowSorting="True"
ShowStatusBar="True"
CssClass="GridVClass"
Width="100%"
Height="100%" CellPadding="4"
GridLines="None" AllowPaging="True"
Visible="true"
OnInsertCommand="GrvTask_InsertCommand"
OnNeedDataSource="GrvTask_NeedDataSource"
OnUpdateCommand="GrvTask_UpdateCommand"
OnDeleteCommand="GrvTask_DeleteCommand"
OnSelectedIndexChanged="GrvTask_SelectedIndexChanged"
OnItemCommand="GrvTask_ItemCommand"
EnableTheming="False"
OnItemDataBound="GrvTask_ItemDataBound"
OnDetailTableDataBind="GrvTask_DetailTableDataBind"
PageSize="20">
<MasterTableView
CommandItemDisplay="Top"
DataKeyNames=" TaskId"
EditMode="InPlace">
<DetailTables>
<telerik:GridTableView
Name="TaskItems"
BorderColor="Gray"
BorderStyle="solid"
BorderWidth="1px"
BackColor="LemonChiffon"
HeaderStyle-BackColor="LemonChiffon"
ItemStyle-BackColor="White"
AlternatingItemStyle-BackColor="GhostWhite"
CommandItemDisplay="Top"
CommandItemStyle-BackColor="LemonChiffon"
CommandItemStyle-BorderColor="Gray"
CommandItemStyle-BorderStyle="solid"
CommandItemStyle-BorderWidth="1px"
AllowPaging="true"
PageSize="6"
EditMode="inPlace"
Width="100%" runat="server"
DataKeyNames="Id">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton"
UpdateImageUrl="../../App_Themes/Images/Update.gif"
EditImageUrl="../../App_Themes/Images/EditIcn.gif"
InsertImageUrl="../../App_Themes/Images/Insert.gif"
HeaderText="Edit"
CancelImageUrl="../../App_Themes/Images/Cancel.gif">
<ItemStyle Width="25px" HorizontalAlign="Left" />
<HeaderStyle Width="25px" HorizontalAlign="Left" />
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="Name"
HeaderText="Task Name" UniqueName="Name">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" Wrap="False" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SeqNo"
HeaderText="SeqNo" UniqueName="SeqNo">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" Wrap="False" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="AmtNote"
HeaderText="Amt." UniqueName="AmtNote">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" Wrap="False" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="OfNote"
HeaderText="Amt. Of" UniqueName="OfNote">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" Wrap="False" />
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="TemplateColumn"
HeaderText="Priority" >
<ItemTemplate>
<asp:Label id="lblPriority" runat="server">
<%
# TaskItemId %>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlPriority" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="ddlPriority_SelectedIndexChanged"
OnDataBinding = "ddlPriority_DataBindingR"
Width="100%"
style="z-index:1000"
/>
</EditItemTemplate>
<HeaderStyle Width="90px" HorizontalAlign="Left"/>
<ItemStyle Width ="90px" HorizontalAlign="Left" />
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn
HeaderText="View Notes"
UniqueName ="ShowNotes"
ButtonType="ImageButton"
ImageUrl="../../Images/ViewNotes.gif"
CommandName="TaskItemNotes"
AutoPostBackOnFilter ="True">
<ItemStyle Width ="40px" HorizontalAlign="Left" />
<HeaderStyle Width ="40px" HorizontalAlign="Left" />
</telerik:GridButtonColumn>
<telerik:GridTemplateColumn
HeaderText="View Contacts"
UniqueName ="Contacts"
DataField="Select" AutoPostBackOnFilter ="True">
<ItemTemplate >
<img src="../../App_Themes/Images/Docs/document_info_64.png"
onclick="OpenAllocatedContacts('<%# DataBinder.Eval(Container.DataItem, "Id") %>');
return false;"
/>
</ItemTemplate>
<ItemStyle Width ="40px" HorizontalAlign="Left" />
<HeaderStyle Width ="40px" HorizontalAlign="Left" />
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn ConfirmText="Are you sure you want to deallocate this taskItem?"
ButtonType="ImageButton"
ImageUrl="../../App_Themes/Images/Delete.gif"
CommandName="Delete" Text="Delete"
UniqueName="DeleteColumn" HeaderText="Delete">
<HeaderStyle Width="20px" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" Width="20px"/>
</telerik:GridButtonColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton"
UpdateImageUrl="../../App_Themes/Images/Update.gif"
EditImageUrl="../../App_Themes/Images/EditIcn.gif"
InsertImageUrl="../../App_Themes/Images/Insert.gif"
HeaderText="Edit"
CancelImageUrl="../../App_Themes/Images/Cancel.gif">
<ItemStyle Width="25px" HorizontalAlign="Left" />
<HeaderStyle Width="25px" HorizontalAlign="Left" />
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="Name"
HeaderText="Task Name" UniqueName="Name">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" Wrap="False" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="SeqNo"
HeaderText="SeqNo" UniqueName="SeqNo">
<ItemStyle HorizontalAlign="Left" />
<HeaderStyle HorizontalAlign="Left" Wrap="False" />
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn UniqueName="TemplateColumn"
HeaderText="Priority" >
<ItemTemplate>
<asp:Label id="lblPriority" runat="server">
<%
# SPlanId %>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:DropDownList ID="ddlPriority" runat="server"
AutoPostBack="true"
OnSelectedIndexChanged="ddlPriority_SelectedIndexChanged"
OnDataBinding = "ddlPriority_DataBindingR"
Width="100%"
style="z-index:1000"
/>
</EditItemTemplate>
<HeaderStyle Width="90px" HorizontalAlign="Left"/>
<ItemStyle Width ="90px" HorizontalAlign="Left" />
</telerik:GridTemplateColumn>
<telerik:GridButtonColumn
HeaderText="View Notes"
UniqueName ="ShowNotes"
ButtonType="ImageButton"
ImageUrl="../../Images/ViewNotes.gif"
CommandName="vNotes"
AutoPostBackOnFilter ="True">
<ItemStyle Width ="40px" HorizontalAlign="Left" />
<HeaderStyle Width ="40px" HorizontalAlign="Left" />
</telerik:GridButtonColumn>
<telerik:GridButtonColumn ConfirmText="Are you sure you want to deallocate this task?"
ButtonType="ImageButton"
ImageUrl="../../App_Themes/Images/Delete.gif"
CommandName="Delete" Text="Delete"
UniqueName="DeleteColumn" HeaderText="Delete">
<HeaderStyle Width="20px" HorizontalAlign="Left" />
<ItemStyle HorizontalAlign="Left" Width="20px"/>
</telerik:GridButtonColumn>
</Columns>
<CommandItemTemplate>
<table width="100%" style="border-right: #003333 thin solid; border-top: #003333 thin solid;
padding-bottom: 2px; margin: 1px; border-left: #003333 thin solid; padding-top: 2px;
border-bottom: #003333 thin solid"
bordercolor="#336666">
<tr>
<td align="left" style="width: 50%">
<asp:LinkButton ID="LinkButton2"
runat="server"
OnClientClick="OpenUnallocatedTasks();return false;">
<img style="border:0px"
alt=""
src="../../RadControls/Grid/Skins/AddRecord.gif"
/>Allocate Tasks
</asp:LinkButton>
</td>
<td align="right" style="width: 50%">
<asp:LinkButton ID="LinkButton4" runat="server" CommandName="Re bindGrid">
<img style="border:0px" alt="" src="../../RadControls/Grid/Skins/Refresh.gif" />
Refresh
</asp:LinkButton>
</td>
</tr>
</table>
</CommandItemTemplate>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<ActiveItemStyle BackColor="Bisque" />
<SelectedItemStyle BackColor="Coral" />
<EditItemStyle BackColor="Bisque" CssClass="SelectedItem" />
</telerik:RadGrid>