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

Editor in Radwindow Template

5 Answers 82 Views
Window
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 02 Nov 2011, 04:27 PM
I'm trying to use a radeditor inside a radwindow template (so I can get the results in code-behind).  I used this demo as a template:
http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx

The other controls in the template render and function fine but the radeditor simply does not appear

    <telerik:RadWindow runat="server" ID="RadWindow_ContentTemplate" RestrictionZoneID="ContentTemplateZone"
        Width="700px" Height="500px" Modal="true">
        <ContentTemplate>
            <div class="contButton">
                <asp:TextBox ID="Textbox1" runat="server" />
            </div>
            <asp:TextBox ID="tbxCombinedFile" runat="server" />
            <div class="contButton">
                <asp:Button ID="Button2" Text="send value through code-behind" runat="server" OnClick="Button2_Click" /></div>
            <asp:Button ID="btnSaveEditor" Text="Save File through code-behind" runat="server"
                OnClick="btn_Editor_Save" /></div>
            <div id="editorWrapper" style="padding5pxdisplaynone;">
                <telerik:RadEditor runat="server" ID="RadEditor1" Height="444px" EditModes="All"
                    StripFormattingOnPaste="None" StripFormattingOptions="None" ToolbarMode="Default"
                    Width="699px" Skin="Telerik">
                    <Content>
                    </Content>
                    <SpellCheckSettings SpellCheckProvider="PhoneticProvider" WordIgnoreOptions="None">
                    </SpellCheckSettings>
                </telerik:RadEditor>
            </div>
        </ContentTemplate>
    </telerik:RadWindow>

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 03 Nov 2011, 12:02 PM
Hello David,

There is a known issue in this scenario. The RadWindow moves its content in the DOM (so as to render it as a direct child of the form element) and this breaks the RadEditor. There is a simple workaround, however - call the Editor's onParentNodeChanged() method when you show the RadWindow:
<telerik:RadWindow runat="server" ID="RadWindow_ContentTemplate" OnClientShow="fixEditor" . . . >
. . . . . .
</telerik:RadWindow>

function fixEditor()
{
    $find("<%=RadEditor1.ClientID %>").onParentNodeChanged();
}

The exact behavior you describe, however, is a result of the display: none being set to the RadEditor's parent:
<div id="editorWrapper" style="padding: 5px; display: none;">
                <telerik:RadEditor runat="server" ID="RadEditor1"


Once removed things should be working as expected.

Greetings,
Marin
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
0
david
Top achievements
Rank 1
answered on 03 Nov 2011, 01:52 PM
Hi Marin,  I tried the changes and no joy, here is the updated code
   
    <telerik:RadWindow runat="server" ID="RadWindow_ContentTemplate" RestrictionZoneID="ContentTemplateZone"
        Width="700px" Height="500px" Modal="true" OnClientShow="fixEditor">
        <ContentTemplate>
                <asp:TextBox ID="Textbox1" runat="server" />
            <asp:TextBox ID="tbxCombinedFile" runat="server" />
            <div class="contButton">
                <asp:Button ID="Button2" Text="send value through code-behind" runat="server" OnClick="Button2_Click" /></div>
            <asp:Button ID="btnSaveEditor" Text="Save File through code-behind" runat="server" OnClick="btn_Editor_Save" /></div>
 
                <telerik:RadEditor runat="server" ID="RadEditor1"  EditModes="All"
                    StripFormattingOnPaste="None" StripFormattingOptions="All" ToolbarMode="Default" 
                    Skin="Telerik">
                    <Content>
                    </Content>
                    <SpellCheckSettings SpellCheckProvider="PhoneticProvider" WordIgnoreOptions="None">
                    </SpellCheckSettings>
                </telerik:RadEditor>
 
        </ContentTemplate>
    </telerik:RadWindow>
                 <script type="text/javascript">
                    function fixEditor() {
                        $find("<%=RadEditor1.ClientID %>").onParentNodeChanged();
                    }
0
david
Top achievements
Rank 1
answered on 04 Nov 2011, 01:43 PM
Guys, any suggestions ?
0
Marin Bratanov
Telerik team
answered on 04 Nov 2011, 03:47 PM
Hi David,

In your current code there is a closing </div> tag that has no opening tag, right after the btnSaveEditor button. This causes the RadWindow's contentTemplate to be closed prematurely and thus the RadEditor is left out of it. I am attaching the page where I tested your code and things are working fine for me after I corrected the HTML. I would also advise that you change the ID of the RadWindow, as this resembles the ID of the ContentTemplate itself too closely, just in case.


All the best,
Marin
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
0
david
Top achievements
Rank 1
answered on 04 Nov 2011, 04:13 PM
Thank you so much
Tags
Window
Asked by
david
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
david
Top achievements
Rank 1
Share this question
or