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

RadWindow Closing

1 Answer 101 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rodney
Top achievements
Rank 2
Rodney asked on 18 May 2017, 04:47 PM

I have a RadWindow with a RadEditor defined on it. When a user enters more than the MaxTextLength value for the RadEditor with an error. When you click OK for the error pop-up the RadWindow Closes. I need to be able to get the error message and keep the window open. Here's the definition for the Window, any help would be appreciated.

<telerik:RadWindow RenderMode="Classic" runat="server" ID="rwLogEntry" Modal="true" Behaviors="Close, Move"
    Title="Add Log Entry" Skin="Telerik" EnableShadow="true" Width="800px" Height="300">
    <ContentTemplate>
        <div id="spnLogEntryDate" runat="server" class="formRow">
            <div class="floatLeft">
                <asp:TextBox ID="txtBxIssueLogEntryId" runat="server" Style="display: none" Text="0" />
                <label for="lblLogEntryDate">Created Date:</label>
                <asp:Label ID="lblLogEntryDate" runat="server" />
            </div>
        </div>
        <div id="spnLogEntryUser" runat="server" class="formRow">
            <div class="floatLeft">
                <label for="lblLogEntryUser">Added By:</label>
                <asp:Label ID="lblLogEntryUser" runat="server" />
            </div>
        </div>
        <div class="formRow">
            <label for="redLogText">Details: </label>
            <div style="width: 100%">
                <telerik:RadEditor ID="redLogText" runat="server" EditModes="Design"
                    MaxTextLength="4000" SkinID="DefaultSetOfTools" ContentAreaMode="iframe" OnClientInit="CharCountInit"
                    Height="255px" Width="70%" Style="background-color: White; display: inline-block;"
                    Skin="Default">
                    <Tools>
                        <telerik:EditorToolGroup>
                            <telerik:EditorSeparator Visible="true" />
                            <telerik:EditorTool Name="Cut" />
                            <telerik:EditorTool Name="Copy" />
                            <telerik:EditorTool Name="Paste" />
                            <telerik:EditorSeparator Visible="true" />
                            <telerik:EditorSplitButton Name="Undo" />
                            <telerik:EditorSplitButton Name="Redo" />
                            <telerik:EditorSeparator Visible="true" />
                            <telerik:EditorTool Name="Bold" />
                            <telerik:EditorTool Name="Italic" />
                            <telerik:EditorTool Name="Underline" />
                            <telerik:EditorSeparator Visible="true" />
                            <telerik:EditorTool Name="JustifyLeft" />
                            <telerik:EditorTool Name="JustifyRight" />
                            <telerik:EditorTool Name="JustifyCenter" />
                            <telerik:EditorSeparator Visible="true" />
                            <telerik:EditorDropDown Name="FontName" />
                            <telerik:EditorDropDown Name="FontSize" />
                            <telerik:EditorSeparator Visible="true" />
                            <telerik:EditorTool Name="AjaxSpellCheck" />
                        </telerik:EditorToolGroup>
                    </Tools>
                    <CssFiles>
                        <telerik:EditorCssFile Value="" />
                    </CssFiles>
                    <Modules>
                        <telerik:EditorModule Name="RadEditorStatistics" Visible="true" Enabled="true"></telerik:EditorModule>
                    </Modules>
                </telerik:RadEditor>
                <asp:RequiredFieldValidator ID="rfvLogTextValid" runat="server" CssClass="validator" ControlToValidate="redLogText"
                    Text="Required" ErrorMessage="Details is a Required Field" ToolTip="This is a Required Field" SetFocusOnError="true"
                    ValidationGroup="LOGVALIDGROUP" />
                <br />
                <asp:Label ID="lblErrorMsg" runat="server" CssClass="validator"></asp:Label>
            </div>
        </div>
        <div class="formRow">
            <div class="floatRight">
                <asp:LinkButton ID="lnkBtnSaveLogEdit" runat="server" OnClick="lnkBtnSaveLogEdit_Click" ValidationGroup="LOGVALIDGROUP" CssClass="silverButton">
                    <span id="spnIssueLog" runat="server">Submit</span>
                </asp:LinkButton>
                <asp:LinkButton ID="lnkBtnLogEditCancel" runat="server" OnClick="lnkBtnLogEditCancel_Click" CausesValidation="false" Text="Cancel"
                    CssClass="floatRightLink" />
            </div>
        </div>
    </ContentTemplate>
</telerik:RadWindow>

1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 23 May 2017, 11:02 AM

Hello Rodney,

I am not sure what the server code of these buttons does and where the OK button is, but at this point I can suggest you use AJAX to prevent the postbacks from disposing (and, effectively, closing) the RadWindow. The following article explains how: http://docs.telerik.com/devtools/aspnet-ajax/controls/window/how-to/how-to-use-radwindow-with-ajax.

Regards,

Marin Bratanov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Window
Asked by
Rodney
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Share this question
or