This is a migrated thread and some comments may be shown as answers.

RadWindow doesn't work in updatepanel

3 Answers 225 Views
Window
This is a migrated thread and some comments may be shown as answers.
Haniyeh
Top achievements
Rank 1
Haniyeh asked on 05 Jan 2013, 10:26 AM
hi
i have a page that contains an update panel, and all of my page are user controls.
one of them has grid view and the grid view contain an image button .if user is clicking on it, the rad window should be display.
but it doesn't show.
what am i doing now?(i used this demo to do it but :( nothing happen )
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NormalTickets.ascx.cs" Inherits="NormalTickets" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
        <style type="text/css">
            .orderText
            {
                font: normal 10pt tahoma;
                margin-top: 6px;
            }
        </style>
       
    </telerik:RadCodeBlock>
   
<div id="mainDiv">
 
   
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="true" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function ShowEditForm(id, rowIndex) {
                var grid = $find("<%= RadGrid1.ClientID %>");
 
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);
 
                window.radopen("EditFormcs.aspx?EmployeeID=" + id, "رزرو بلیط");
                return false;
            }
            function ShowInsertForm() {
                window.radopen("EditFormcs.aspx", "رزرو بلیط2");
                return false;
            }
            function refreshGrid(arg) {
                if (!arg) {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                }
                else {
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                }
            }
            function RowDblClick(sender, eventArgs) {
                window.radopen("Pg_Normaltickets.aspx?siD=" + eventArgs.getDataKeyValue("sid"), "نمایش تاریخ ها");
            }
        </script>
        </telerik:RadCodeBlock>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
                 
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <br />
    <div dir="rtl">
    <telerik:RadGrid OnItemCreated="RadGrid1_ItemCreated" ID="RadGrid1" runat="server"
        AllowPaging="True" Width="80%" 
    AutoGenerateColumns="False" CellSpacing="0" Font-Names="Tahoma"
    GridLines="None" Skin="Metro" Culture="fa-IR">
        <MasterTableView DataKeyNames="sid" ClientDataKeyNames="sid"
            Width="100%" CommandItemDisplay="Top" PageSize="10">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="sid" HeaderText="sid" ReadOnly="True"
                    SortExpression="sid" UniqueName="sid"
                    Visible="False">
                    <ItemStyle Font-Names="Tahoma" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="descr" HeaderText="نمایش" SortExpression="FirstName"
                    UniqueName="FirstName">
                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="descr1" HeaderText="کارگردان" SortExpression="LastName"
                    UniqueName="LastName">
                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="duration" HeaderText="مدت اجرا" SortExpression="Title"
                    UniqueName="Title">
                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="saloonName"
                    FilterControlAltText="Filter column column" HeaderText="مکان"
                    UniqueName="column">
                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="price"
                    FilterControlAltText="Filter column1 column" HeaderText="قیمت"
                    UniqueName="column1">
                    <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                    <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                </telerik:GridBoundColumn>
 
                <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                     
                    <ItemTemplate>
                        <asp:ImageButton ID="EditLink" runat="server" ImageUrl="~/images/buy.png"
                            onclick="imgbtn_buy_Click"
                            ToolTip="برای انتخاب سانس مورد نظرتان و خرید کلیک کنید." />
                    </ItemTemplate>
                     
                </telerik:GridTemplateColumn>
 
               </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
            <CommandItemTemplate>
                 
            </CommandItemTemplate>
        </MasterTableView>
        <ClientSettings>
            <Selecting AllowRowSelect="true"></Selecting>
            <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
            <Animation AllowColumnReorderAnimation="True" />
        </ClientSettings>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
    </telerik:RadGrid>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="320px"
                Width="310px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                Modal="true">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    </div>
 
 
 
 
<div id="basket">
          
        <div style="text-align:center;color:Gray;font:10pt tahoma;">
         <telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server"
             HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" Width="540px">
             <telerik:RadCaptcha ID="RadCaptcha1" runat="server" BackColor="Transparent"
                 CaptchaTextBoxCssClass="capthchaTextBox"
                 CaptchaTextBoxLabel="لطفاً حروف تصویر را وارد نمایید"
                 CaptchaTextBoxLabelCssClass="capthchalable" Font-Size="Small" Height="76px"
                 Visible="False" Width="381px">
             </telerik:RadCaptcha>
         </telerik:RadAjaxPanel>
         <div style="margin-left: 43px; margin-right: 66px">
                            
                               <asp:Button ID="btn_buyticket" runat="server" BackColor="#08AFEE"
                                   BorderColor="#08AFEE" BorderStyle="Solid" BorderWidth="1px" Font-Size="10pt"
                                   ForeColor="White" Text="اظافه به سبد خرید" Width="127px"
                                   onclick="btn_buyticket_Click" />
                            
                           </div>
       </div>
    </div>
    </div>
     <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Select distinct S.SID as SID,Descr,SaloonName,unitprice From [Section] S , SansDet D,Saloon S1  Where S.SID=D.SID And D.Date1>dbo.persiandate(getdate()) and S.SaloonID=S1.SaloonID And SS=1 and type=1 Order by S.SID "></asp:SqlDataSource>
                
i made the another page to show in rad window,

Note : my purpose is user controls came to update panel to avoid refresh and post back.my user control name is NormalTickets and it has a gridview to show the name oh theater and the button in each row should show the another page.the second page has another gridview to show the theater date and time and user can select one of them to get the ticket.(first page resend the id of ticket to another page)

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 05 Jan 2013, 11:54 AM
Hi,

Generally placing the RadWindow in an update panel is not recommended, because the rendered HTML is moved from its original location in the markup. This will most often result in the expected functionality simply not working. Please take a look into this for more information.

Hope this helps.

Thanks,
Princy.
0
Kaushal
Top achievements
Rank 2
answered on 07 Jan 2013, 07:16 AM
Hi Haniyeh,

I have used Edit Form Template to achieve this which gives you more flexibility for formatting content as Well.
Please follow bellow Telerik Demo link to achieve this.Let me know in case you need any help on making it to work at your end.
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/popupeditform/defaultcs.aspx
0
Haniyeh
Top achievements
Rank 1
answered on 07 Jan 2013, 07:56 AM
Hi Kaushal ,
thank you for your reason. i put frame instead of update panel grammatically in code behind to show the grid view the same as demo.
.
thanks a lot :)
Tags
Window
Asked by
Haniyeh
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kaushal
Top achievements
Rank 2
Haniyeh
Top achievements
Rank 1
Share this question
or