How to leave FormTemplate popup open after saving row?

7 posts, 0 answers
  1. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 30 Mar 2012 Link to this post

    I currently have a popup with an Update and a Cancel button.
    I would like to have 3 buttons - Update, Save and Cancel.
    Save would do just that, but NOT close the popup.
    This behavior is typical of many applications where Update means save+close and Save means save+leave-open.

    How would go about implementing this Save functionality for my popup?

    Thanks

    Jim
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 31 Mar 2012 Link to this post

    Hello Jim,

    Can you please provide information or code, which method you used for save/update/cancel ?

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 31 Mar 2012 Link to this post

    I have included some snippets of the aspx page below.
    Radbutton8 is where the Insert or Update takes place.
    I'd like to add another button that performs a "Save" - i.e., an update that leaves the popup open for additional editing.

    <telerik:RadGrid ClientSettings-Resizing-AllowColumnResize="true" PageSize="20"
                ID="grdDataSpecs" Width="100%" ShowStatusBar="True"
                            DataSourceID="sqlDataSpec" runat="server"
                AutoGenerateColumns="False" AllowSorting="True"
                            AllowPaging="True" GridLines="None" Skin="Vista" ClientSettings-Selecting-AllowRowSelect="true"
                            AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                AllowAutomaticUpdates="True" AllowFilteringByColumn="True"
                            AllowMultiRowSelection="True"
                ClientSettings-Scrolling-AllowScroll="true" ClientSettings-Scrolling-UseStaticHeaders="true"
                            ClientSettings-Scrolling-ScrollHeight="100%" OnItemCommand="grdDataSpecs_ItemCommand" OnItemDataBound="grdDataSpecs_ItemDataBound"
                            OnPreRender="grdDataSpecs_PreRender" OnItemUpdated="grdDataSpecs_ItemUpdated" OnHTMLExporting="grdDataSpecs_HTMLExporting" OnExportCellFormatting="grdDataSpecs_ExportCellFormatting" OnItemCreated="grdDataSpecs_ItemCreated"
                            OnItemInserted="grdDataSpecs_ItemInserted" CellSpacing="0">
                            <ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true"
                                OpenInNewWindow="true">
                                <Excel Format="Html" />
                            </ExportSettings>
                            <MasterTableView DataSourceID="sqlDataSpec" DataKeyNames="ID" AllowMultiColumnSorting="True"
                                CommandItemDisplay="Top" AllowAutomaticDeletes="True"
                                AllowAutomaticInserts="True" AllowAutomaticUpdates="True" EditMode="PopUp">
     
    ...
     
    <EditFormSettings CaptionDataField="BriefField_Name" CaptionFormatString="Editing Data Specification"
                                    EditFormType="Template" InsertCaption="New Data Specification" PopUpSettings-Modal="true">
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                    <FormTemplate>
                                        <div id="divEdit" runat="server" class="formTemplate" style="height: 500px;">
                                            <div class="tabContent" style="height: 30px; padding-bottom:5px;">
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <telerik:RadButton ID="RadButton8" runat="server" CommandName='<%# ((bool)DataBinder.Eval(Container, "OwnerTableView.IsItemInserted")) ? "PerformInsert" : "Update" %>'
                                                                Text='<%# ((bool)DataBinder.Eval(Container, "OwnerTableView.IsItemInserted")) ? "Create" : "Update" %>'
                                                                Visible='<%# (Boolean)Session["EditProcess"] %>'>
                                                            </telerik:RadButton>
                                                            <telerik:RadButton ID="RadButton10" runat="server" CausesValidation="False" CommandName="Cancel"
                                                                Text='<%# ((Boolean)Session["EditProcess"]) ? "Cancel" : "Close" %>'>
                                                            </telerik:RadButton>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
     
    ...
  5. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 04 Apr 2012 Link to this post

    Hello Jim,

    Have you tried setting e.KeepInEditMode = true in the ItemUpdated event handler? This should leave the edit form open after the update takes place.

    All the best,
    Tsvetina
    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.
  6. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 04 Apr 2012 Link to this post

    I tried setting e.KeepInEditMode = true in the ItemUpdated event, but that did not work - the popup still closes.
    I do some simple processing in ItemCommand for the Update command, but just setting some hidden label's Text attribute which in turn is bound to the database.  I have included the opening section of the formtemplate below.
    By the way, it is a rather busy template including a RadTabStrip, RadMultiPage and several RadPageViews.
    Any suggestions as to what to try next?
    Thanks.

    <EditFormSettings CaptionDataField="BriefField_Name" CaptionFormatString="Editing Data Specification"
                        EditFormType="Template" InsertCaption="New Data Specification" PopUpSettings-Modal="true">
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                        <FormTemplate>
                            <div id="divEdit" runat="server" class="formTemplate" style="height: 500px;">
                                <div class="tabContent" style="height: 30px; padding-bottom: 5px;">
                                    <table>
                                        <tr>
                                            <td>
                                                <telerik:RadButton ID="RadButton8" runat="server" CommandName='<%# ((bool)DataBinder.Eval(Container, "OwnerTableView.IsItemInserted")) ? "PerformInsert" : "Update" %>'
                                                    Text='<%# ((bool)DataBinder.Eval(Container, "OwnerTableView.IsItemInserted")) ? "Create" : "Update" %>'
                                                    Visible='<%# (Boolean)Session["EditProcess"] %>'>
                                                </telerik:RadButton>
                                                <telerik:RadButton ID="RadButton10" runat="server" CausesValidation="False" CommandName="Cancel"
                                                    Text='<%# ((Boolean)Session["EditProcess"]) ? "Cancel" : "Close" %>'>
                                                </telerik:RadButton>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                                <telerik:RadTabStrip ID="tspDataSpecs" runat="server" MultiPageID="RadMultiPageDataSpecs"
                                    SelectedIndex="0">
                                    <Tabs>
                                        <telerik:RadTab runat="server" ID="tabDetails" Text="Details" PageViewID="pagDataSpecsDetails"
                                            Selected="true">
                                        </telerik:RadTab>
                                        <telerik:RadTab runat="server" ID="tabValues" Text="Values" PageViewID="pagValues">
                                        </telerik:RadTab>
                                        <telerik:RadTab runat="server" ID="tabHelpText" Text="Help Text" PageViewID="pagHelpText">
                                        </telerik:RadTab>
                                        <telerik:RadTab runat="server" ID="tabComments" Text="Comments / Special Instructions"
                                            PageViewID="pagComments">
                                        </telerik:RadTab>
                                        <telerik:RadTab runat="server" ID="tabImpTech" Text="Implementation Technique" PageViewID="pagImpTech">
                                        </telerik:RadTab>
                                    </Tabs>
                                </telerik:RadTabStrip>
                                <telerik:RadMultiPage ID="RadMultiPageDataSpecs" runat="server" SelectedIndex="0"
                                    RenderSelectedPageOnly="false">
                                    <telerik:RadPageView ID="pagDataSpecsDetails" runat="server">
     
    ...
  7. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 04 Apr 2012 Link to this post

    **Update**
    I just tried your suggested technique on a simpler popup template (no tabs) and it works fine.
    It's only the tabbed popup that will not close.
    Jim
  8. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 09 Apr 2012 Link to this post

    Hi Jim,

    Do you have AJAX in this scenario? If so, check what happens when you disable it, are there any server errors?
    If you cannot see anything more specific about the problem, I would suggest you to open a formal support ticket and send us a runnable sample of the problemmatic scenario, so that we can also debug it.

    Kind regards,
    Tsvetina
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017