RadWindow Closing

2 posts, 0 answers
  1. Rodney
    Rodney avatar
    54 posts
    Member since:
    Mar 2015

    Posted 18 May 2017 Link to this post

    I have a RadWindow with a RadEditor defined on it. When a user enters more than the MaxTextLength value for the RadEditor a pop-up displays 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">
            <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 id="spnLogEntryUser" runat="server" class="formRow">
                <div class="floatLeft">
                    <label for="lblLogEntryUser">Added By:</label>
                    <asp:Label ID="lblLogEntryUser" runat="server" />
            <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;"
                                <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:EditorCssFile Value="" />
                            <telerik:EditorModule Name="RadEditorStatistics" Visible="true" Enabled="true"></telerik:EditorModule>
                    <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 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 ID="lnkBtnLogEditCancel" runat="server" OnClick="lnkBtnLogEditCancel_Click" CausesValidation="false" Text="Cancel"
                        CssClass="floatRightLink" />
  2. Marin Bratanov
    Marin Bratanov avatar
    5623 posts

    Posted 23 May 2017 Link to this post

    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.


    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.
Back to Top