Radwindow is closing after doing a postback(Urgent)

3 posts, 0 answers
  1. Pravallika
    Pravallika avatar
    30 posts
    Member since:
    Mar 2014

    Posted 23 Feb 2015 Link to this post

    Hai all,

    I have a Radgrid in that i have Edit and Add functionality when i click on Edit or Add it will open Radwindow there i have ListBox and some button opertions .
    when it is going to postback the radwindow is closing and reopend why it happens while doing postbacks i dnt want to close radwindow how to do see the below code once
    <asp:UpdatePanel ID="upnlCompany" runat="server">
           <ContentTemplate>
               <telerik:RadWindow ID="RadWin_AddEditCompany" runat="server" Modal="true" OnClientBeforeShow="OnClientBeforeShow"
                   Behaviors="Close,Maximize,Reload" VisibleStatusbar="true" Height="430px" Width="860px">
                   <ContentTemplate>
                       <asp:UpdatePanel ID="upnlSaveUpdateCompany" runat="server" UpdateMode="Conditional">
                           <ContentTemplate>
            <table>
                                   <tr>
                                       <td class="tdLabel" align="center">
                                           <asp:Label ID="lblUnSelectedEmployees" runat="server" Text="Other Company Employees"></asp:Label>
                                       </td>
                                       <td>
                                       </td>
                                       <td class="tdLabel" align="center">
                                           <asp:Label ID="lblSelectedEmployees" runat="server" Text="Selected Employees"></asp:Label>
                                       </td>
                                   </tr>
                                   <tr>
                                       <td colspan="3" style="height: 7px">
                                       </td>
                                   </tr>
                                   <tr>
                                       <td>
                                           <asp:ListBox ID="lbxUnSelectedEmployees" runat="server" Height="200px" SelectionMode="Multiple">
                                           </asp:ListBox>
                                           <cc1:ListSearchExtender ID="listSearchOtherEmployee" runat="server" Enabled="True"
                                               QueryPattern="Contains" PromptPosition="Top" PromptCssClass="ListSearchExtenderPrompt"
                                               TargetControlID="lbxUnSelectedEmployees">
                                           </cc1:ListSearchExtender>
                                       </td>
                                       <td class="tdControl">
                                           <asp:Button ID="btnSelect" runat="server" Text=">>" CausesValidation="false" OnClick="btnSelect_Click" /><br />
                                           <br />
                                       </td>
                                       <td>
                                           <asp:ListBox ID="lbxSelectedEmployees" runat="server" Height="200px" SelectionMode="Multiple">
                                           </asp:ListBox>
                                           <cc1:ListSearchExtender ID="listSearchSelectedEmployee" runat="server" Enabled="True"
                                               QueryPattern="Contains" PromptPosition="Top" PromptCssClass="ListSearchExtenderPrompt"
                                               TargetControlID="lbxSelectedEmployees">
                                           </cc1:ListSearchExtender>
                                       </td>
                                   </tr>
                               </table>
    <asp:Button ID="btnSave" runat="server" CommandName="Insert" Width="50px" Text="Save"
                                               OnClick="btnSave_Click" />
    </ContentTemplate>
                       </asp:UpdatePanel>
    </ContentTemplate>
               </telerik:RadWindow>
    <div class="layout">
                   <telerik:RadGrid ID="rgCompany" runat="server" Width="60%" OnNeedDataSource="rgCompany_NeedDataSource"
                       OnItemCommand="rgCompany_ItemCommand" PagerStyle-Mode="Advanced" AllowFilteringByColumn="true">
                       <MasterTableView Width="100%" DataKeyNames="CompanyID">
                           <Columns>
                               <telerik:GridTemplateColumn DataField="CompanyName" HeaderText="Company Name" FilterControlWidth="125"
                                   HeaderStyle-Width="40%" SortExpression="CompanyName">
                                   <ItemTemplate>
                                       <asp:Label ID="lblCompanyName" runat="server" Text='<%# Eval("CompanyName") %>' />
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               <telerik:GridTemplateColumn HeaderText="Description" AllowFiltering="false" HeaderStyle-Width="30%"
                                   SortExpression="CompanyDescription">
                                   <ItemTemplate>
                                       <asp:Label ID="lblCompanyDesc" runat="server" Text='<%# Eval("CompanyDescription") %>' />
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               
                               <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="15%" HeaderStyle-HorizontalAlign="Center"
                                   ItemStyle-HorizontalAlign="Center">
                                   <HeaderTemplate>
                                       <telerik:RadButton ID="rbAddCompany" runat="server" Text="Add" ButtonType="LinkButton"
                                           CommandName="RowAdd" CausesValidation="false" Skin="Outlook">
                                           <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4" />
                                       </telerik:RadButton>
                                   </HeaderTemplate>
                                   <ItemTemplate>
                                       <telerik:RadButton ID="rbtnEdit" runat="server" Text="Edit" CommandName="RowEdit"
                                           CausesValidation="false" CommandArgument='<%# Eval("CompanyID") %>' ButtonType="LinkButton">
                                       </telerik:RadButton>
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                           </Columns>
                       </MasterTableView>
                        
                   </telerik:RadGrid>
               </div>
     </ContentTemplate>
       </asp:UpdatePanel>


    when i am doing some operations in listbox adding radwindow is closing how to stop it
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 23 Feb 2015 Link to this post

    HelloPravallika,

    You must keep the RadWindow outside of any UpdatePanels or AJAX settings, as explained here: http://www.telerik.com/help/aspnet-ajax/window-ajaxifying.html. In this case, you must take out the RadWin_AddEditCompany RadWindowout of the upnlCompany UpdatePanel.

    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Pravallika
    Pravallika avatar
    30 posts
    Member since:
    Mar 2014

    Posted 23 Feb 2015 in reply to Marin Bratanov Link to this post

    i kept it in out side but still its not working
Back to Top