I have a Rad Grid placed inside an Ajax Panel. And I have placed an Image Editor control in the nestedViewTemplate. My grid is suppose to load asynchronously so I have a button on click of the button the grid is suppose to load. When I place the Image Editor control the grid fails to load with a Javascript error. If I remove the Image Editor control it works fine. Please find the code snippet. below is the aspx.cs code.
Below is the code behind code.
Would appreciate any help....
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<!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
>
<
telerik:RadStyleSheetManager
ID
=
"RadStyleSheetManager1"
runat
=
"server"
/>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<%--Needed for JavaScript IntelliSense in VS2010--%>
<%--For VS2008 replace RadScriptManager with ScriptManager--%>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
/>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
/>
</
Scripts
>
</
telerik:RadScriptManager
>
<
script
type
=
"text/javascript"
>
//Put your JavaScript code here.
</
script
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
div
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel2"
runat
=
"server"
Height
=
"100%"
Width
=
"100%"
LoadingPanelID
=
"LoadingPanel"
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
OnClick
=
"Button1_Click"
Text
=
"Button"
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
>
<
MasterTableView
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
/>
</
RowIndicatorColumn
>
<
NestedViewTemplate
>
<
table
>
<
tr
>
<
td
>
<
telerik:RadImageEditor
ImageUrl
=
"Sunset.jpg"
ID
=
"RadImageFront"
runat
=
"server"
Width
=
"100px"
Height
=
"100px"
>
</
telerik:RadImageEditor
>
</
td
>
</
tr
>
</
table
>
</
NestedViewTemplate
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
/>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Id"
FilterControlAltText
=
"Filter column column"
HeaderText
=
"Id"
UniqueName
=
"column"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>
</
telerik:RadAjaxPanel
>
</
div
>
</
form
>
</
body
>
</
html
>
Below is the code behind code.
public partial class Default : System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt = new DataTable("test");
dt.Columns.Add(new DataColumn("Id"));
DataRow dr;
dr = dt.NewRow();
dr[0] = 5;
dt.Rows.Add(dr);
RadGrid1.DataSource = dt;
RadGrid1.DataBind();
}
}