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

Editor Empty when AjaxPanel is on the page

1 Answer 57 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 03 Feb 2015, 02:21 PM
Like the subject says, the editor is in control that's used as an editor for a grid. When I go to edit a row, the value in the editor is always blank and unclickable when an AjaxPanel is on the page. I can remove the panel is everything works as it should. Even though there is no value shown, I can still hit update and the real values are still saved. Am I missing something that has to do with AJAX and the editor?

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 06 Feb 2015, 09:30 AM

Hi Michael,

Could you check if this applies to your case: http://www.telerik.com/support/kb/aspnet-ajax/editor/details/radeditor-content-not-saved-after-ajax-update-in-ie9-firefox-google-chrome-and-safari?

Also, can you confirm there is no script error on the page, as this may break the editor functionality?

I an also advise that you examine the following demo that shows how a RadEditor functions properly in a RadGrid and AJAX is used: http://demos.telerik.com/aspnet-ajax/editor/examples/edittemplate/defaultcs.aspx. Could you compare it with your setup and see whether you can imitate the approach or whether you can find the difference that is causing the problem?

Yet another idea I can suggest is trying to force it to update its UI when the page renders in case this is a rendering problem. Here is a basic example:

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
    <asp:Button ID="Button1" Text="show editor" OnClick="Button1_Click" runat="server" />
    <asp:Panel ID="Panel1" runat="server" Visible="false">
        <telerik:RadEditor ID="RadEditor1" runat="server">
            <Content>
                some sample content
            </Content>
        </telerik:RadEditor>
        <asp:Button ID="Button2" Text="save" OnClick="Button2_Click" runat="server" />
        <asp:Label ID="Label1" Text="" runat="server" />
        <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
            <script type="text/javascript">
                function repaintEditor() {
                    var editor = $find("<%=RadEditor1.ClientID%>");
                    if (editor) {
                        editor.repaint();
                        //you can also try editor.onParentNodeChanged()
                        //and a small timeout in either case
                    }
                    Sys.Application.remove_load(repaintEditor);
                }
                Sys.Application.add_load(repaintEditor);
            </script>
        </telerik:RadScriptBlock>
    </asp:Panel>
</telerik:RadAjaxPanel>
protected void Button1_Click(object sender, EventArgs e)
{
    Panel1.Visible=true;
}
protected void Button2_Click(object sender, EventArgs e)
{
    Label1.Text = RadEditor1.Content;
}


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Editor
Asked by
Michael
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or