How to keep RAD Window open on Button Click in the window

2 posts, 0 answers
  1. Santanu Das
    Santanu Das avatar
    7 posts
    Member since:
    Mar 2010

    Posted 23 Jun 2014 Link to this post


    I have a Radwindow with a button.
    I am opening that window through a button click in the parent window.
    But when I cam clicking the button on the RAD Window it disappears, I have tried with RAD Ajax Pannel but it that case the values posted in the window from my parent page disappears. Is there any standard way to keep the rad window on postback also.

    Code for showing the window in aspx.vb page:

    Protected Sub cmd_Search_Ref_Doc_Click(sender As Object, e As System.Web.UI.ImageClickEventArgs) Handles cmd_Search_Ref_Doc.Click

            MySql = "Select Txn_Type from Master_Inventory_Txn_Type WHERE type_id =" & txt_Doc_No_Req.Value

            Dim SearchDt As DataTable = ComFunc.GetData(MySql)

            Dim TextBoxComment As Label = DirectCast(Rad_Window_Ref_Doc.ContentContainer.FindControl("lbl_Document_Name"), Label)
            TextBoxComment.Text = SearchDt.Rows(0).Item("Txn_Type")

            Dim RadWindowGrid As RadGrid = DirectCast(Rad_Window_Ref_Doc.ContentContainer.FindControl("radGridDocument"), RadGrid)
            MySql = "Select Doc_No, Doc_Date from BL_Txn_Item_Journal WHERE Txn_Type =" & txt_Doc_No_Req.Value
            SearchDt = ComFunc.GetData(MySql)
            RadWindowGrid.DataSource = SearchDt

            Dim script As String = "function f(){$find(""" + Rad_Window_Ref_Doc.ClientID + """).show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)

        End Sub

    Code for Rad Window in ASPX Page:

     <telerik:RadWindow ID="Rad_Window_Ref_Doc" runat="server" 
                Skin="Outlook" VisibleOnPageLoad="false" EnableViewState="false"
                Width="550" Height="300" Modal="True" ReloadOnShow="true" ShowContentDuringLoad="false"
                Behaviors="Close, Maximize, Move, Reload" BorderStyle="Solid" 
                Title="Reference Documents" VisibleStatusbar="False">
                            <table width="500px" style="height:70px;">
                                        Search Document type
                                        <asp:Label ID="lbl_Document_Name" Font-Bold="true" runat="server" Text=""></asp:Label>
                                        Document No
                                        <asp:TextBox ID="txt_Document_No" Width="200px" runat="server"></asp:TextBox> 
                                        <asp:ImageButton ID="cmd_Search_Document_No"  ImageUrl="~/Project/image/button/search-button.jpg" runat="server" />


                     <telerik:RadGrid ID="radGridDocument" 
                            runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
                            AllowPaging="false" GridLines="None" ShowGroupPanel="true" Width="500" Skin="Outlook">
                            <PagerStyle Mode="NumericPages"></PagerStyle>
                            <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true"></ClientSettings>
                            <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
                                <Pdf PageHeight="210mm" PageWidth="297mm" PageTopMargin="45mm">
                            <MasterTableView  DataKeyNames="Doc_No" AllowMultiColumnSorting="True" GroupLoadMode="Server">
                                <telerik:GridBoundColumn  DataField="Doc_No" HeaderText="Doc No" SortExpression="Doc_No" UniqueName="Doc_No" > 
                                <HeaderStyle Width="250px" HorizontalAlign="Center" />
                                   <ItemStyle HorizontalAlign="Left" />
                               <telerik:GridDateTimeColumn DataField="Doc_Date" HeaderText ="Date" 
                                UniqueName="Doc_Date" DataFormatString="{0:dd/MMM/yyyy}" PickerType="None"></telerik:GridDateTimeColumn>
                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="ViewCh" Text="Select Challan"
                                UniqueName="SelectCH" ImageUrl="~/Project/image/RadControls/Grid/Skins/Default/Edit.gif"></telerik:GridButtonColumn>

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Jun 2014 in reply to Santanu Das Link to this post

    Hi Santanu Das,

    Please try to  wrap the entire RadWindow in an update panel with the concept that the controls inside will perform an AJAX request or will be updated by one will no longer work, as they will not be inside the update panel actually. In Your  scenario try to place the UpdatePanel (or RadAjaxPanel) inside the ContentTemplate and bind the RadGrid in appropriate event. Please have a look into this help documentation for further help.

  3. DevCraft R3 2016 release webinar banner
Back to Top