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

Image Editor throwing Javascript error when used in a Rad Grid in side an Ajax panel.

1 Answer 30 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Ankit
Top achievements
Rank 1
Ankit asked on 17 Nov 2011, 11:18 AM
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.

<%@ 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">
<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();
    }
}
 Would appreciate any help....

1 Answer, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 21 Nov 2011, 02:31 PM
Hi Ankit,

Unfortunately I wasn't able to reproduce the issue that you are experiencing, using the setup that you have provided. Could it be that you are using an older version of the controls? There was a similar issue with the first release of the ImageEditor control - Q2.2011, but this has been resolved since.

The best option would be to open a support ticket and attach a stripped-down sample runnable project that reproduces the issue.

Hope this helps.

Kind regards,
Niko
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ImageEditor
Asked by
Ankit
Top achievements
Rank 1
Answers by
Niko
Telerik team
Share this question
or