RadWindow Closing

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

    Posted 18 May 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">
        <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>
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3859 posts

    Posted 23 May 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.

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