RadWindow doesn't work in updatepanel

4 posts, 0 answers
  1. Haniyeh
    Haniyeh avatar
    5 posts
    Member since:
    Jan 2013

    Posted 05 Jan 2013 Link to this post

    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">
                    font: normal 10pt tahoma;
                    margin-top: 6px;
    <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"), "نمایش تاریخ ها");
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
        <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>
                    <telerik:GridBoundColumn DataField="sid" HeaderText="sid" ReadOnly="True"
                        SortExpression="sid" UniqueName="sid"
                        <ItemStyle Font-Names="Tahoma" />
                    <telerik:GridBoundColumn DataField="descr" HeaderText="نمایش" SortExpression="FirstName"
                        <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                        <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                    <telerik:GridBoundColumn DataField="descr1" HeaderText="کارگردان" SortExpression="LastName"
                        <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                        <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                    <telerik:GridBoundColumn DataField="duration" HeaderText="مدت اجرا" SortExpression="Title"
                        <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                        <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                    <telerik:GridBoundColumn DataField="saloonName"
                        FilterControlAltText="Filter column column" HeaderText="مکان"
                        <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                        <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                    <telerik:GridBoundColumn DataField="price"
                        FilterControlAltText="Filter column1 column" HeaderText="قیمت"
                        <HeaderStyle Font-Names="Tahoma" Font-Size="10pt" ForeColor="#08AFEE" />
                        <ItemStyle Font-Names="Tahoma" Font-Size="10pt" />
                    <telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
                            <asp:ImageButton ID="EditLink" runat="server" ImageUrl="~/images/buy.png"
                                ToolTip="برای انتخاب سانس مورد نظرتان و خرید کلیک کنید." />
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                <Selecting AllowRowSelect="true"></Selecting>
                <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
                <Animation AllowColumnReorderAnimation="True" />
    <FilterMenu EnableImageSprites="False"></FilterMenu>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
                <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="320px"
                    Width="310px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
    <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"
                     CaptchaTextBoxLabel="لطفاً حروف تصویر را وارد نمایید"
                     CaptchaTextBoxLabelCssClass="capthchalable" Font-Size="Small" Height="76px"
                     Visible="False" Width="381px">
             <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" />
         <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)
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Jan 2013 Link to this post


    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kaushal
    Kaushal avatar
    6 posts
    Member since:
    Jan 2013

    Posted 07 Jan 2013 Link to this post

    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.
  5. Haniyeh
    Haniyeh avatar
    5 posts
    Member since:
    Jan 2013

    Posted 07 Jan 2013 Link to this post

    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 :)
Back to Top