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

Edit Grid column error

6 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike_T
Top achievements
Rank 1
Mike_T asked on 07 Aug 2010, 12:49 PM
hello,

I have updated my web project to use the latest fix from telerik (2010.2.803.35) when i try to edit the grid i am receiving the following error (Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException:
Automatic updates, inserts are supported only when the template is IBindableTemplate)
the error is not showing up when using the (2010.1.519.35) version any hints?

 

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Groups.aspx.vb" Inherits="EmployeeTaxes.Groups" MasterPageFile="~/MasterPages/Backend.Master" EnableEventValidation="false" ViewStateEncryptionMode="Never" 
ValidateRequest="false" MaintainScrollPositionOnPostback="true" %>
  
  
<asp:Content ID="Groups" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
  
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
<script type="text/javascript">
  
function OnClientClose_EDITOR(radWindow) {
  
window["<%= RadAjaxManager1.ClientID %>"].AjaxRequestWithTarget("<%=DataGrid.UniqueID%>", "RebindDataGrid");
  
}
  
function refreshGrid(arg) {
  
if (!arg) {
  
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
  
}
  
else {
  
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
  
}
  
}
  
function RowDblClick(sender, eventArgs) {
  
window.radopen("EditGroups.aspx?GroupID=" + eventArgs.getDataKeyValue("GroupID"), "Search");
  
}
  
</script>
  
</telerik:RadCodeBlock>
  
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" />
  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
  
<AjaxSettings>
  
<telerik:AjaxSetting AjaxControlID="MainDiv">
  
<UpdatedControls>
  
<telerik:AjaxUpdatedControl ControlID="MainDiv" LoadingPanelID="RadAjaxLoadingPanel1" />
  
</UpdatedControls>
  
</telerik:AjaxSetting>
  
</AjaxSettings>
  
</telerik:RadAjaxManager>
  
<div id="MainDiv" runat="server">
  
<telerik:RadMultiPage ID="RadMultiPage1" SelectedIndex="0" runat="server" Width="100%">
  
<telerik:RadPageView ID="PageView0" runat="server" Width="100%">
  
<telerik:RadWindowManager ID="TitleWindow" runat="server" Visible="true" Behavior="Move,Maximize,Close"
  
Modal="true">
  
<Windows>
  
<telerik:RadWindow Width="970" Height="550" VisibleStatusbar="false" NavigateUrl="Window.aspx"
  
ID="Search" runat="server" VisibleOnPageLoad="false" Behavior="Move,Maximize,Close" />
  
</Windows>
  
</telerik:RadWindowManager>
  
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Visible="true" Behavior="Maximize,Close"
  
Modal="true">
  
<Windows>
  
<telerik:RadWindow Width="400" Height="250" VisibleStatusbar="false" NavigateUrl="Window.aspx"
  
ID="RadWindow1" runat="server" VisibleOnPageLoad="false" />
  
</Windows>
  
</telerik:RadWindowManager>
  
<telerik:RadWindowManager ID="TitleWindow1" runat="server" Visible="true" Behavior="Move,Maximize,Close"
  
Modal="true">
  
<Windows>
  
<telerik:RadWindow Width="780" Height="550" VisibleStatusbar="false" NavigateUrl="Window.aspx"
  
ID="Search1" runat="server" VisibleOnPageLoad="false" Behavior="Move,Maximize,Close" />
  
</Windows>
  
</telerik:RadWindowManager>
  
<div align="center">
  
<telerik:RadGrid ID="DataGrid" runat="server" ShowStatusBar="True" AllowFilteringByColumn="True"
  
Width="100%" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false"
  
AllowPaging="True" PageSize="10">
  
<MasterTableView Dir="RTL" AutoGenerateColumns="False" AllowSorting="true" CommandItemDisplay="Top"
  
AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false"
  
ClientDataKeyNames="GroupID" DataKeyNames="GroupID" EditFormSettings-EditFormType="Template">
  
<HeaderStyle HorizontalAlign="Center" />
  
<FilterItemStyle HorizontalAlign="Center" />
  
<NoRecordsTemplate>
  
No Records Found.
  
</NoRecordsTemplate>
  
<CommandItemTemplate>
  
<asp:ImageButton ID="btnAdd" CommandName="Insert" ImageUrl="~/images/button_Client.jpg"
  
runat="server" CausesValidation="false" Style="cursor: hand" AlternateText=" " />
  
</CommandItemTemplate>
  
<Columns>
  
<telerik:GridButtonColumn UniqueName="Edit" CommandName="Edit" ButtonType="ImageButton"
  
ImageUrl="~/images/icon_edit.gif" Text="" HeaderText="">
  
<HeaderStyle Width="35px" HorizontalAlign="center" />
  
</telerik:GridButtonColumn>
  
<telerik:GridBoundColumn DataField="GroupID" Visible="false" HeaderText="GroupID"
  
SortExpression="GroupID" UniqueName="GroupID" />
  
<telerik:GridBoundColumn DataField="GroupName" HeaderText=" " SortExpression="GroupName"
  
UniqueName="GroupName" /> 
  
</Columns>
  
<PagerStyle Mode="NextPrevNumericAndAdvanced" PageButtonCount="20" />
  
</MasterTableView>
  
<ClientSettings AllowColumnsReorder="True" EnableRowHoverStyle="true">
  
<Selecting AllowRowSelect="true" />
  
<ClientEvents OnRowDblClick="RowDblClick" />
  
</ClientSettings>
  
</telerik:RadGrid>
  
</div>
  
</telerik:RadPageView>
  
</telerik:RadMultiPage>
  
  
</div>
  
</asp:Content>

 

 

6 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 09 Aug 2010, 03:47 PM
Hi Mike,

You have set EditFormSettings-EditFormType="Template" for the MasterTable, however you have not defined any template:
<MasterTableView EditFormSettings-EditFormType="Template">
    <EditFormSettings>
        <FormTemplate>
              ...         
        </FormTemplate>
    </EditFormSettings>
</MasterTableView>


Kind regards,
Pavel
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
0
Mike_T
Top achievements
Rank 1
answered on 10 Aug 2010, 12:05 AM
The problem is that i am opening a radwindow from the code

 

 

Protected Sub DataGrid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles DataGrid.ItemCommand
  
If (e.CommandName = RadGrid.EditCommandName) Then
  
ViewState("Edit") = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("DepartmentID").ToString()
  
TitleWindow.Windows(0).NavigateUrl = "EditDepartments.aspx?DepartmentID=" & ViewState("Edit")
End If

0
Pavel
Telerik team
answered on 11 Aug 2010, 09:22 AM
Hi Mike,

If you are using RadWindow as your edit form, you do not need to set EditFormType="Template".

Regards,
Pavel
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
0
Mike_T
Top achievements
Rank 1
answered on 12 Aug 2010, 12:21 PM

Hi Pavel,

Thanks for your reply, when i remove this tag "EditFormSettings-EditFormType="Template", i have the radwindow opened but also in the grid i have the built-in edit fields shows inside the grid.How can i hide these?

Thanks,

0
Accepted
Pavel
Telerik team
answered on 13 Aug 2010, 07:48 AM
Hello Mike,

Try canceling the default behavior from executing like this:
If (e.CommandName = RadGrid.EditCommandName) Then
    e.Canceled = True
    ...
End If

Kind regards,
Pavel
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
0
Mike_T
Top achievements
Rank 1
answered on 13 Aug 2010, 08:45 AM
Thanks Pavel, it worked.
Tags
Grid
Asked by
Mike_T
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Mike_T
Top achievements
Rank 1
Share this question
or