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

Sys.WebForms.PageRequestManagerServerErrorException: Insert item is available only when grid is in insert mode.

3 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James Shelton Agar
Top achievements
Rank 2
James Shelton Agar asked on 22 Mar 2010, 11:55 PM
I have a inline editing grid, everything was fine but when i updated to Q12010 316 version, i got an error message "Sys.WebForms.PageRequestManagerServerErrorException: Insert item is available only when grid is in insert mode."

any idea?

<telerik:RadGrid SkinID="GridVista" ID="AListingsGrid" runat="server" AllowPaging="True" 
                                AutoGenerateColumns="False" GridLines="None" AllowSorting="False" PageSize="50" 
                                AllowMultiRowSelection="False" ShowStatusBar="True" AllowAutomaticDeletes="false" 
                                AllowAutomaticInserts="false" AllowAutomaticUpdates="false" AllowMultiRowEdit="false"
                                <HeaderContextMenu Skin="Vista" EnableTheming="True"
                                    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
                                </HeaderContextMenu> 
                                <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" /> 
                                <MasterTableView CellSpacing="-1" EditMode="InPlace" CommandItemDisplay="Top" ClientDataKeyNames="PageKey"
                                    <CommandItemTemplate> 
                                        <div class="maintainGridTools"
                                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# Not AListingsGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/Control_New.png" /></asp:LinkButton> 
                                            <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# AListingsGrid.EditIndexes.Count = 0 and not AListingsGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/control_edit.png" /></asp:LinkButton> 
                                            <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# AListingsGrid.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/save.png" /></asp:LinkButton> 
                                            <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# AListingsGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/save.png" /></asp:LinkButton> 
                                            <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# AListingsGrid.EditIndexes.Count > 0 Or AListingsGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/Cancel.png" /></asp:LinkButton> 
                                            <asp:LinkButton ID="LinkButtonPageUp" OnClick="barUp" runat="server" Visible='<%# AListingsGrid.EditIndexes.Count = 0 and not AListingsGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/navigate_up.gif" /></asp:LinkButton> 
                                            <asp:LinkButton ID="LinkButtonPageDown" runat="server" OnClick="barDown" Visible='<%# AListingsGrid.EditIndexes.Count = 0 and not AListingsGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/navigate_down.gif" /></asp:LinkButton> 
                                            <asp:LinkButton CssClass="btndelete" ID="LinkButton1" OnClientClick="javascript:return checkDelPage();" 
                                                runat="server" CommandName="DeleteSelected" Visible='<%# AListingsGrid.EditIndexes.Count = 0 and not AListingsGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="i/16x16/Active/control_delete.png" /></asp:LinkButton> 
                                            <asp:LinkButton CssClass="btntoggleActive" ID="LinkBtntoggle" OnClick="ToggleActive" 
                                                runat="server" Visible='<%# AListingsGrid.EditIndexes.Count = 0 and not AListingsGrid.MasterTableView.IsItemInserted %>'>Toggle Active</asp:LinkButton> 
                                        </div> 
                                    </CommandItemTemplate> 
                                    <RowIndicatorColumn Visible="False"
                                        <HeaderStyle Width="20px" /> 
                                    </RowIndicatorColumn> 
                                    <ExpandCollapseColumn Visible="False" Resizable="False"
                                        <HeaderStyle Width="20px" /> 
                                    </ExpandCollapseColumn> 
                                    <Columns> 
                                        <%--<telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="Images/16x16/Active/Cancel.png" 
                                            EditImageUrl="Images/16x16/Active/control_edit.png" UniqueName="EditCommandColumn" 
                                            UpdateImageUrl="Images/16x16/Active/save.png" InsertImageUrl="Images/16x16/Active/save.png"
                                            <HeaderStyle Width="60px" HorizontalAlign="Center" /> 
                                            <ItemStyle Width="60px" HorizontalAlign="Center" /> 
                                        </telerik:GridEditCommandColumn>--%> 
                                        <telerik:GridBoundColumn DataField="PageKey" HeaderText="Ref" UniqueName="Ref" Visible="False"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridTemplateColumn UniqueName="lbldatecreated" HeaderText="Created" Visible="false"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblCreated" runat="server" Text=""></asp:Label> 
                                            </ItemTemplate> 
                                            <EditItemTemplate> 
                                                <asp:Label ID="editLblCrated" runat="server" Text="Label"></asp:Label> 
                                            </EditItemTemplate> 
                                            <HeaderStyle Width="100px" /> 
                                            <ItemStyle Width="100px" /> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn UniqueName="pagename" HeaderText="Name"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblpagename" runat="server" Text=""></asp:Label> 
                                            </ItemTemplate> 
                                            <EditItemTemplate> 
                                                <span> 
                                                    <telerik:RadTextBox SkinID="TextBoxSkin" ID="txtpagename" runat="server" EmptyMessage="" 
                                                        Width="100%"
                                                    </telerik:RadTextBox> 
                                                    <asp:LinkButton ID="lnkBtnCMDEdit" runat="server" OnClick="lnkBtnEdit_Click">Edit Content</asp:LinkButton> 
                                                </span> 
                                            </EditItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn UniqueName="lblpagetype" HeaderText="Type"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblType" runat="server" Text=""></asp:Label> 
                                            </ItemTemplate> 
                                            <EditItemTemplate> 
                                                <telerik:RadComboBox SkinID="ComboSkin" ItemRequestTimeout="1000" CollapseDelay="0" 
                                                    ID="dblkFeatureSelect" AutoPostBack="true" runat="server" AllowCustomText="False" 
                                                    HighlightTemplatedItems="True" MarkFirstMatch="True" Width="85px" OnSelectedIndexChanged="dblkFeatureSelect_SelectedIndexChanged"
                                                    <Items> 
                                                        <telerik:RadComboBoxItem Text="Static Page" Value="P" /> 
                                                        <telerik:RadComboBoxItem Text="Feature" Value="F" /> 
                                                        <telerik:RadComboBoxItem Text="URL" Value="E" /> 
                                                        <%--<telerik:RadComboBoxItem Text="URL (Embedded)" Value="B" />--%> 
                                                    </Items> 
                                                    <CollapseAnimation Type="None"></CollapseAnimation> 
                                                </telerik:RadComboBox> 
                                            </EditItemTemplate> 
                                            <HeaderStyle Width="100px" /> 
                                            <ItemStyle Width="100px" /> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn UniqueName="status" HeaderText="Status"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblActive" runat="server" Text=""></asp:Label> 
                                            </ItemTemplate> 
                                            <EditItemTemplate> 
                                                <telerik:RadComboBox SkinID="ComboSkin" ItemRequestTimeout="1000" CollapseDelay="0" 
                                                    ID="dblkActive" runat="server" AllowCustomText="False" HighlightTemplatedItems="True" 
                                                    MarkFirstMatch="True" Width="80px"
                                                    <Items> 
                                                        <telerik:RadComboBoxItem Text="Active" Value="0" /> 
                                                        <telerik:RadComboBoxItem Text="Pending" Value="1" /> 
                                                    </Items> 
                                                    <CollapseAnimation Type="None"></CollapseAnimation> 
                                                </telerik:RadComboBox> 
                                                <%--                                        <asp:CheckBox ID="chxActive" runat="server" Text="Active" />                                        --%> 
                                            </EditItemTemplate> 
                                            <HeaderStyle Width="95px" /> 
                                            <ItemStyle Width="95px" /> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn UniqueName="lbldatemodifed" HeaderText="Modified"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblModified" runat="server" Text=""></asp:Label> 
                                            </ItemTemplate> 
                                            <EditItemTemplate> 
                                                <asp:Label ID="edtLblModified" runat="server" Text="Label"></asp:Label> 
                                            </EditItemTemplate> 
                                            <HeaderStyle Width="140px" /> 
                                            <ItemStyle Width="140px" /> 
                                        </telerik:GridTemplateColumn> 
                                        <%--<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="Classic" 
                                            ConfirmText="Delete this page?" ConfirmTitle="Delete" ImageUrl="Images/recycle.gif" 
                                            UniqueName="DeleteColumn"
                                            <HeaderStyle Width="40px" HorizontalAlign="Center" /> 
                                            <ItemStyle Width="40px" HorizontalAlign="Center" /> 
                                        </telerik:GridButtonColumn>--%> 
                                    </Columns> 
                                    <EditFormSettings> 
                                        <PopUpSettings ScrollBars="None" /> 
                                    </EditFormSettings> 
                                </MasterTableView> 
                                <ClientSettings AllowKeyboardNavigation="True" EnableRowHoverStyle="True" AllowRowsDragDrop="true"
                                    <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowDeselected" /> 
                                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" /> 
                                    <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                                    <Resizing AllowColumnResize="True" EnableRealTimeResize="True" /> 
                                    <ClientEvents OnRowDropping="onRowDropping" /> 
                                </ClientSettings> 
                                <FilterMenu Skin="Vista" EnableTheming="True"
                                    <CollapseAnimation Type="OutQuint" Duration="200" /> 
                                </FilterMenu> 
                                <SortingSettings EnableSkinSortStyles="False" /> 
                                <StatusBarSettings LoadingText="Loading Pages, please wait..." /> 
                            </telerik:RadGrid> 

3 Answers, 1 is accepted

Sort by
0
James Shelton Agar
Top achievements
Rank 2
answered on 23 Mar 2010, 12:10 AM
fixed, was perfrom isinterminserted=false in code
0
liu qingshui
Top achievements
Rank 1
answered on 12 May 2010, 10:56 AM
Hey, now I face the same problem,can you give a detail explainatin,
isinterminserted=false,where should I put?
0
Pavlina
Telerik team
answered on 13 May 2010, 08:29 AM
Hi Liu,

You may test whether settings explicitly e.Item.OwnerTableView.IsItemInserted = false from within the InsertCommand handler makes a difference.

Also can you please double-check that the record is added in the grid source and you do not have e.Canceled = true somewhere in your InsertCommand handler?

Sincerely yours,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
James Shelton Agar
Top achievements
Rank 2
Answers by
James Shelton Agar
Top achievements
Rank 2
liu qingshui
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or