Hi
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
RadWindowGrid.DataBind()
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">
<ContentTemplate>
<table width="500px" style="height:70px;">
<tr>
<td>
Search Document type
</td>
<td>
<asp:Label ID="lbl_Document_Name" Font-Bold="true" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td>
Document No
</td>
<td>
<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" />
</td>
</tr>
</table>
<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">
</Pdf>
</ExportSettings>
<MasterTableView DataKeyNames="Doc_No" AllowMultiColumnSorting="True" GroupLoadMode="Server">
<Columns>
<telerik:GridBoundColumn DataField="Doc_No" HeaderText="Doc No" SortExpression="Doc_No" UniqueName="Doc_No" >
<HeaderStyle Width="250px" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<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>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</ContentTemplate>
</telerik:RadWindow>
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
RadWindowGrid.DataBind()
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">
<ContentTemplate>
<table width="500px" style="height:70px;">
<tr>
<td>
Search Document type
</td>
<td>
<asp:Label ID="lbl_Document_Name" Font-Bold="true" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td>
Document No
</td>
<td>
<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" />
</td>
</tr>
</table>
<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">
</Pdf>
</ExportSettings>
<MasterTableView DataKeyNames="Doc_No" AllowMultiColumnSorting="True" GroupLoadMode="Server">
<Columns>
<telerik:GridBoundColumn DataField="Doc_No" HeaderText="Doc No" SortExpression="Doc_No" UniqueName="Doc_No" >
<HeaderStyle Width="250px" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Left" />
</telerik:GridBoundColumn>
<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>
</Columns>
</MasterTableView>
</telerik:RadGrid>
</ContentTemplate>
</telerik:RadWindow>