Making change from in-place editing to editforms with a form template results in the following error:
Apparently this is happening at other places within the application as well in the deployed version, causing some components (such as RadUpload) not to function correctly. Any feedback on how to solve this would be appreciated. So, I imagine it isn't a Grid error per se, but a ScriptManager error.
Have tried different revs of telerik controls (1015, 926, 917), and different .net levels (4.5, 4.51, 4.0). Have uninstalled and reinstalled with no success.
Working Code:
Not Working Code:
Unhandled exception at line 3, column 62240 in http://localhost:49573/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;AjaxControlToolkit,+Version=4.5.7.1005,+Culture=neutral,+PublicKeyToken=28f01b0e84b6d53e:en-US:a410b875-5cb5-4d5e-9cf6-234163990602:ea597d4b:b25378d2
0x800a138f - JavaScript runtime error: Unable to set property 'control' of undefined or null reference
Apparently this is happening at other places within the application as well in the deployed version, causing some components (such as RadUpload) not to function correctly. Any feedback on how to solve this would be appreciated. So, I imagine it isn't a Grid error per se, but a ScriptManager error.
Have tried different revs of telerik controls (1015, 926, 917), and different .net levels (4.5, 4.51, 4.0). Have uninstalled and reinstalled with no success.
Working Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestForm.aspx.cs" Inherits="TestForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadTextBox
ID
=
"txtSelect"
runat
=
"server"
Width
=
"100%"
/>
<
telerik:RadGrid
ID
=
"RadGrid_Master"
runat
=
"server"
AllowPaging
=
"True"
PageSize
=
"5"
DataSourceID
=
"SqlDataSource_Master"
AutoGenerateColumns
=
"False"
AllowAutoMaticUpdates
=
"true"
>
<
MasterTableView
DataSourceID
=
"SqlDataSource_Master"
DataKeyNames
=
"Key"
EditMode
=
"InPlace"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn1"
/>
<
telerik:GridBoundColumn
DataField
=
"Key"
DataType
=
"System.Guid"
FilterControlAltText
=
"Filter Key column"
HeaderText
=
"Key"
ReadOnly
=
"True"
SortExpression
=
"Key"
UniqueName
=
"Key"
/>
<
telerik:GridBoundColumn
DataField
=
"Name"
FilterControlAltText
=
"Filter Name column"
HeaderText
=
"Name"
SortExpression
=
"Name"
UniqueName
=
"Name"
MaxLength
=
"30"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Master"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:TestConnection %>"
SelectCommand = "SELECT Key, Name FROM Products"
UpdateCommand = "UPDATE Products SET Name = @Name WHERE Key = @Key">
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Name"
/>
<
asp:ControlParameter
ControlID
=
"RadGrid_Master"
Name
=
"Key"
PropertyName
=
"SelectedValue"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Detail"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:TestConnection %>" SelectCommand="SELECT * FROM Pricing WHERE RateIndictor = 'W' AND Key = @Key">
<
SelectParameters
>
<
asp:ControlParameter
ControlID
=
"RadGrid_Master"
Name
=
"Key"
PropertyName
=
"SelectedValue"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
</
form
>
</
body
>
</
html
>
Not Working Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestForm.aspx.cs" Inherits="TestForm" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
telerik:RadTextBox
ID
=
"txtSelect"
runat
=
"server"
Width
=
"100%"
/>
<
telerik:RadGrid
ID
=
"RadGrid_Master"
runat
=
"server"
AllowPaging
=
"True"
PageSize
=
"5"
DataSourceID
=
"SqlDataSource_Master"
AutoGenerateColumns
=
"False"
AllowAutoMaticUpdates
=
"true"
>
<
MasterTableView
DataSourceID
=
"SqlDataSource_Master"
DataKeyNames
=
"Key"
EditMode
=
"EditForms"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn1"
/>
<
telerik:GridBoundColumn
DataField
=
"Key"
DataType
=
"System.Guid"
FilterControlAltText
=
"Filter Key column"
HeaderText
=
"Key"
ReadOnly
=
"True"
SortExpression
=
"Key"
UniqueName
=
"Key"
/>
<
telerik:GridBoundColumn
DataField
=
"Name"
FilterControlAltText
=
"Filter Name column"
HeaderText
=
"Name"
SortExpression
=
"Name"
UniqueName
=
"Name"
MaxLength
=
"30"
/>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
FormTemplate
>
<
telerik:RadTextBox
ID
=
"RadTextBox1"
Runat
=
"server"
LabelWidth
=
"64px"
Resize
=
"None"
Text='<%# Bind("Name", "{0}") %>' Width="160px" MaxLength="30" />
<
br
/>
<
asp:Button
ID
=
"btnUpdate"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'/>
<
asp:Button
ID
=
"btnCancel"
Text
=
"Cancel"
runat
=
"server"
CausesValidation
=
"False"
CommandName
=
"Cancel"
/>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Master"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:TestConnection %>"
SelectCommand = "SELECT Key, Name FROM Products"
UpdateCommand = "UPDATE Products SET Name = @Name WHERE Key = @Key">
<
UpdateParameters
>
<
asp:Parameter
Name
=
"Name"
/>
<
asp:ControlParameter
ControlID
=
"RadGrid_Master"
Name
=
"Key"
PropertyName
=
"SelectedValue"
/>
</
UpdateParameters
>
</
asp:SqlDataSource
>
<
asp:SqlDataSource
ID
=
"SqlDataSource_Detail"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:TestConnection %>" SelectCommand="SELECT * FROM Pricing WHERE RateIndictor = 'W' AND Key = @Key">
<
SelectParameters
>
<
asp:ControlParameter
ControlID
=
"RadGrid_Master"
Name
=
"Key"
PropertyName
=
"SelectedValue"
/>
</
SelectParameters
>
</
asp:SqlDataSource
>
</
form
>
</
body
>
</
html
>