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

Problem opening RadWindows in a ContentPages

5 Answers 138 Views
Window
This is a migrated thread and some comments may be shown as answers.
Felipe de Jesús
Top achievements
Rank 1
Felipe de Jesús asked on 28 Jun 2011, 08:29 PM
Good evening Telerik Team.

I have a problem trying to open a RadWindow from codebehind. I trying diferente approaches that i found in the forums, but i obtain diferent issues.

Sometimes i recive an error message that says: Two differents components with the same ID. Or simply, the RadWindow never s

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs"
    Inherits="eBPRCHTest.MasterPage" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" dir="ltr">
<head runat="server">
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Master Page</title>
    <!-- Meta Tags -->
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="es-MX" />
    <meta name="description" content="Sistema de Generación de Reportes BPR para el área de Hair Care" />
    <meta name="author" content="Felipe de Jesús Meléndez Valencia" />
    <!-- CSS -->
    <link href="css/style.css?t=<%=DateTime.Now.Ticks.ToString() %>" media="screen" rel="Stylesheet"
        type="text/css" />
    <!-- JavaScript -->
    <asp:ContentPlaceHolder ID="cphHead" runat="server" />
    <telerik:RadScriptBlock ID="rsblScripts" runat="server">
 
        <script type="text/javascript">
            // Close RadMenu after click
            function OnClientItemClicked(sender, eventArgs) {
                sender.close();
            }
 
            // Move logout option for the RadMenu to the right
            function clientLoad(sender) {
                var node0 = sender.findItemByText('<%= GetGlobalResourceObject("Localization", "mnuLogout") %>');
                node0.get_element().style.cssText = "float: right";
 
                var node1 = sender.findItemByValue(1);
                node1.get_element().style.cssText = "float: right";
            }
 
            // Edit Grids on double click
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
        </script>
 
    </telerik:RadScriptBlock>
</head>
<body>
    <div id="pageContainer">
        <form id="formContainer" runat="server" style="height: 100%">
        <asp:ToolkitScriptManager ID="tsmneBPRHC" runat="server" />
        <telerik:RadFormDecorator ID="rfdceBPRHC" runat="server" DecoratedControls="All" />
        <telerik:RadWindowManager ID="rwmneBPRHC" runat="server" />
        <div id="wrapper">
            <div id="header">
                <table cellpadding="0" cellspacing="0" style="height: 75px" width="100%">
                    <tbody>
                        <tr>
                            <td rowspan="2" colspan="1" style="width: 868px;">
                                <br />
                            </td>
                            <td style="height: 10px">
                                <asp:Label ID="lblWelcome" CssClass="lblWelcome" runat="server" Text="<%$ Resources:Localization, lblWelcome %>" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblUserName" CssClass="lblUserName" runat="server" Text="Felipe de Jesús Meléndez Valencia" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <br />
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div id="navigation">
                <telerik:RadMenu ID="rmnuMainMenu" runat="server" OnClientLoad="clientLoad" OnClientItemClicked="OnClientItemClicked"
                    OnItemClick="rmnuMainMenu_ItemClick" Width="100%" />
            </div>
            <telerik:RadAjaxManager ID="ramnAJAXManager" runat="server" />
            <telerik:RadAjaxLoadingPanel ID="ralpLoading" runat="server" />
            <telerik:RadAjaxPanel ID="rapnAJAXPanel" runat="server" LoadingPanelID="ralpLoading">
                <div id="content">
                    <asp:ContentPlaceHolder ID="cphCont" runat="server" />
                </div>
            </telerik:RadAjaxPanel>
            <div id="footer">
            </div>
        </div>
        </form>
    </div>
</body>
</html>

And the code from my ContentPage is:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="CatMI.aspx.cs" Inherits="eBPRCHTest.CatMI" %>
 
<asp:Content ID="Head" ContentPlaceHolderID="cphHead" runat="server">
 
    <script type="text/javascript">
             
     
        function closeWin() {
            var oWnd = $find("<%=rwndMI.ClientID%>");
            oWnd.close();
        }
    </script>
 
</asp:Content>
<asp:Content ID="Cont" ContentPlaceHolderID="cphCont" runat="server">
    <table style="text-align: left" width="600px">
        <thead>
            <tr>
                <td class="tblTitle">
                    <asp:Label ID="lblTitle" runat="server" CssClass="lblTitle" Text="MAKING INSTRUCTION" />
                </td>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td>
                    <asp:SqlDataSource ID="sdsMIItems" runat="server" ConnectionString="<%$ ConnectionStrings:eBPRHCConnectionString %>"
                        DeleteCommand="DELETE FROM [tMIItems] WHERE [PKMIItem] = @PKMIItem;" SelectCommand="SELECT [PKMIItem], [FKMI], [miItemTypeDesc], [miItemLocDesc], [miItemNumStep], [miItemDesc], [miItemCode], (SELECT [matDescript] FROM [tMaterials] WHERE [matCode] = [miItemCode] AND [FKTrain] = (SELECT [PKTrain] FROM [tTrains] WHERE [trnDescript] = @trnDescript)) AS miItemCodeDesc, [miItemObserv], [miItemPercent] FROM [tMIItems] INNER JOIN [tMIItemType] ON [FKMIItemType] = [PKMIItemType] INNER JOIN [tMIItemLocat] ON [FKMIItemLocat] = [PKMIItemLocat] WHERE ([FKMI] = @FKMI) ORDER BY [MIItemOrder];"
                        InsertCommand=" DECLARE @OrderNum AS INT SET @OrderNum = (SELECT ISNULL(MAX([miItemOrder]), 0) + 1 FROM [tMIItems] WHERE (FKMI = @FKMI)); INSERT INTO [tMIItems] ([FKMI], [FKMIItemType], [FKMIItemLocat], [miItemOrder], [miItemNumStep], [miItemDesc], [miItemCode], [miItemObserv], [miItemPercent]) VALUES (@FKMI, @FKMIItemType, @FKMIItemLocat, @OrderNum, @miItemNumStep, @miItemDesc, @miItemCode, @miItemObserv, @miItemPercent);">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="lblTrainDesc" Name="trnDescript" PropertyName="Text" />
                            <asp:ControlParameter ControlID="rcmbMI" Name="FKMI" PropertyName="SelectedValue"
                                Type="Int32" />
                        </SelectParameters>
                        <InsertParameters>
                            <asp:ControlParameter ControlID="rcmbMI" Name="FKMI" PropertyName="SelectedValue"
                                Type="Int32" />
                            <asp:Parameter Name="FKMIItemType" />
                            <asp:Parameter Name="FKMIItemLocat" />
                            <asp:Parameter Name="miItemNumStep" />
                            <asp:Parameter Name="miItemDesc" />
                            <asp:Parameter Name="miItemCode" />
                            <asp:Parameter Name="miItemObserv" />
                            <asp:Parameter Name="miItemPercent" />
                        </InsertParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sdsTrains" runat="server" ConnectionString="<%$ ConnectionStrings:eBPRHCConnectionString %>"
                        SelectCommand="SELECT [PKTrain], [trnDescript], [trnPercent], [trnStatus] FROM [tTrains] WHERE  ([FKSubsite] = @FKSubsite) AND ([trnStatus] = 'a') ORDER BY [trnDescript];"
                        OnSelecting="sdsTrains_Selecting">
                        <SelectParameters>
                            <asp:Parameter Name="FKSubsite" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sdsBatchSizes" runat="server" ConnectionString="<%$ ConnectionStrings:eBPRHCConnectionString %>"
                        SelectCommand="SELECT [PKBatchSize], [btcSize], [btcStatus] FROM [tBatchSizes] WHERE (([btcStatus] = 'a') AND ([FKSubsite] = @FKSubsite)) ORDER BY [btcSize];"
                        OnSelecting="sdsBatchSizes_Selecting">
                        <SelectParameters>
                            <asp:Parameter Name="FKSubsite" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sdsMIItemType" runat="server" ConnectionString="<%$ ConnectionStrings:eBPRHCConnectionString %>"
                        SelectCommand="SELECT [PKMIItemType] AS FKMIItemType, [miItemTypeDesc] FROM [tMIItemType]">
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sdsMIItemLocat" runat="server" ConnectionString="<%$ ConnectionStrings:eBPRHCConnectionString %>"
                        SelectCommand="SELECT [PKMIItemLocat] AS FKMIItemLocat, [miItemLocDesc] FROM [tMIItemLocat]">
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sdsMaterials" runat="server" ConnectionString="<%$ ConnectionStrings:eBPRHCConnectionString %>"
                        SelectCommand="SELECT [PKMaterial], [matCode] AS miItemCode, [matDescript], [trnDescript] FROM [tMaterials] INNER JOIN [tTrains] ON [FKTrain] = [PKTrain] WHERE ([PKTrain] = (SELECT [PKTrain] FROM [tTrains] WHERE [trnDescript] = @trnDescript))">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="lblTrainDesc" Name="trnDescript" PropertyName="Text" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
        </tfoot>
        <tbody>
            <tr>
                <td style="text-align: center">
                    <table class="miDetails" style="width: 600px;">
                        <tbody>
                            <tr>
                                <td colspan="4" style="height: 30px">
                                    <asp:UpdatePanel ID="UpdatePanel2" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
                                        <ContentTemplate
                                            <asp:Button ID="btnNewMI" runat="server" Text="Nuevo MI" Width="90px" OnClick="btnNewMI_Click" />
                                            <asp:Button ID="btnCreateMI" runat="server" Text="Crear Edición" Width="90px" Visible="false"
                                                OnClick="btnCreateMI_Click" />
                                            <asp:Button ID="btnCopyMI" runat="server" Text="Copiar MI" OnClientClick="openWin('Copiar MI'); return false;"
                                                Width="90px" Visible="false" OnClick="btnCopyMI_Click" />
                                            <asp:Button ID="btnPermitsMI" runat="server" Text="Permisos" Width="90px" Visible="false"
                                                OnClick="btnPermitsMI_Click" />
                                            <asp:Button ID="btnStatusMI" runat="server" Text="Cambiar Estado" Width="90px" Visible="false"
                                                OnClick="btnStatusMI_Click" />
                                            <asp:Button ID="btnDeleteMI" runat="server" Text="Eliminar MI" Width="90px" Visible="false"
                                                OnClick="btnDeleteMI_Click" />
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                         
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right">
                                    <asp:Label ID="lblMICode" runat="server" Text="Código:" />
                                </td>
                                <td>
                                    <telerik:RadComboBox ID="rcmbMI" runat="server" AllowCustomText="true" AutoPostBack="True"
                                        DropDownWidth="435px" EnableLoadOnDemand="true" HighlightTemplatedItems="true"
                                        ItemRequestTimeout="1000" MaxLength="13" OnItemsRequested="rcmbMI_ItemsRequested"
                                        OnSelectedIndexChanged="rcmbMI_SelectedIndexChanged">
                                        <HeaderTemplate>
                                            <div>
                                                <table cellpadding="0" cellspacing="0">
                                                    <tr align="center">
                                                        <td style="width: 100px;" align="center">
                                                            Version
                                                        </td>
                                                        <td style="width: 100px;" align="center">
                                                            Fecha
                                                        </td>
                                                        <td style="width: 80px;" align="center">
                                                            Estado
                                                        </td>
                                                        <td style="width: 55px;" align="center">
                                                            Trén
                                                        </td>
                                                        <td style="width: 100px;" align="center">
                                                            Tamaño de Lote
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </HeaderTemplate>
                                        <CollapseAnimation Duration="200" Type="OutQuint" />
                                        <ItemTemplate>
                                            <table cellpadding="0" cellspacing="0">
                                                <tr align="center">
                                                    <td style="width: 100px;" align="center">
                                                        <%# DataBinder.Eval(Container.DataItem, "PKVer") %>
                                                    </td>
                                                    <td style="width: 100px;" align="center">
                                                        <%# System.Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "DateAdd")).ToString("dd/MM/yyyy") %>
                                                    </td>
                                                    <td style="width: 80px;" align="center">
                                                        <%# DataBinder.Eval(Container.DataItem, "Status") %>
                                                    </td>
                                                    <td style="width: 55px;" align="center">
                                                        <%# DataBinder.Eval(Container.DataItem, "TrainDesc") %>
                                                    </td>
                                                    <td style="width: 100px;" align="center">
                                                        <%# DataBinder.Eval(Container.DataItem, "BatchSize")%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </telerik:RadComboBox>
                                </td>
                                <td style="text-align: right">
                                    <asp:Label ID="lblStatus" runat="server" Text="Estado:" />
                                </td>
                                <td style="width: 180px">
                                    <asp:Label ID="lblStatusDesc" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right">
                                    <asp:Label ID="lblTrain" runat="server" Text="Tren:" />
                                </td>
                                <td>
                                    <asp:Label ID="lblTrainDesc" runat="server" />
                                </td>
                                <td style="text-align: right">
                                    <asp:Label ID="lblBatch" runat="server" Text="Tamaño de Lote:" />
                                </td>
                                <td>
                                    <asp:Label ID="lblBatchDesc" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td style="text-align: right">
                                    <asp:Label ID="lblDesc" runat="server" Text="Descripción:" />
                                </td>
                                <td colspan="3">
                                    <asp:Label ID="lblDescript" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td colspan="3">
                                    <asp:Label ID="lblInfo" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" style="height: 0">
                                    <table id="tblApprovers" runat="server" style="background: #ddd" visible="false">
                                        <tr>
                                            <td style="text-align: right; width: 112px">
                                                <asp:Label ID="lblIngProc" runat="server" Text="Ing. de Proceso:  " />
                                            </td>
                                            <td>
                                                <asp:ImageButton ID="ibtApprov1" runat="server" ImageUrl="~/Img/WithOutApprov.png"
                                                    OnClick="ibtApprov1_Click" />
                                            </td>
                                            <td style="text-align: right; width: 112px">
                                                <asp:Label ID="lblQA" runat="server" Text="QA:  " />
                                            </td>
                                            <td>
                                                <asp:ImageButton ID="ibtApprov2" runat="server" ImageUrl="~/Img/WithOutApprov.png"
                                                    OnClick="ibtApprov2_Click" />
                                            </td>
                                            <td style="text-align: right; width: 112px">
                                                <asp:Label ID="lblTSO" runat="server" Text="TSO:  " />
                                            </td>
                                            <td>
                                                <asp:ImageButton ID="ibtApprov3" runat="server" ImageUrl="~/Img/WithOutApprov.png"
                                                    OnClick="ibtApprov3_Click" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                            </td>
                                            <td style="text-align: center">
                                                <asp:Label ID="lblDate1" runat="server" />
                                            </td>
                                            <td>
                                            </td>
                                            <td style="text-align: center">
                                                <asp:Label ID="lblDate2" runat="server" />
                                            </td>
                                            <td>
                                            </td>
                                            <td style="text-align: center">
                                                <asp:Label ID="lblDate3" runat="server" />
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <table width="958px">
        <tbody>
            <tr>
                <td>
                    <telerik:RadGrid ID="rgrdMI" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                        AllowAutomaticUpdates="True" AllowSorting="True" DataSourceID="sdsMIItems" GridLines="None"
                        Visible="False" Width="650px" OnItemCommand="rgrdMI_ItemCommand">
                        <MasterTableView DataSourceID="sdsMIItems" DataKeyNames="PKMIItem" CommandItemDisplay="Top"
                            EditMode="InPlace" Width="100%">
                            <Columns>
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="<%$ Resources:Localization, lblEdit %>">
                                    <ItemStyle CssClass="handCursor" />
                                </telerik:GridEditCommandColumn>
                                <telerik:GridBoundColumn DataField="PKMIItem" DataType="System.Int32" HeaderText="PKMIItem"
                                    ReadOnly="True" SortExpression="PKMIItem" UniqueName="PKMIItem" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="Tipo" UniqueName="ItemType">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem,"miItemTypeDesc")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadComboBox ID="rcmbMIItemType" runat="server" AutoPostBack="true" EnableAutomaticLoadOnDemand="true"
                                            DataSourceID="sdsMIItemType" DataTextField="miItemTypeDesc" DataValueField="FKMIItemType"
                                            OnSelectedIndexChanged="rcmbMIItemType_SelectedIndexChanged" Width="70px" />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Ubicación" UniqueName="ItemLocat">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem,"miItemLocDesc")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadComboBox ID="rcmbMIItemLocat" runat="server" DataSourceID="sdsMIItemLocat"
                                            DataTextField="miItemLocDesc" DataValueField="FKMIItemLocat" Width="70px" />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="miItemNumStep" HeaderText="Paso" SortExpression="miItemNumStep"
                                    UniqueName="miItemNumStep">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem,"miItemNumStep")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtNumStep" runat="server" ReadOnly="true" Text='<%# Bind("miItemNumStep") %>'
                                            Width="35px" />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="miItemDesc" HeaderText="Descripción" SortExpression="miItemDesc"
                                    UniqueName="miItemDesc">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn DataField="miItemCode" DataType="System.Decimal" HeaderText="Código"
                                    SortExpression="miItemCode" UniqueName="miItemCode">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem,"miItemCode")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadComboBox ID="rcmbItemCode" runat="server" AutoPostBack="true" EnableAutomaticLoadOnDemand="true"
                                            DataSourceID="sdsMaterials" DataTextField="miItemCode" DataValueField="miItemCode"
                                            DropDownWidth="255px" OnSelectedIndexChanged="rcmbItemCode_SelectedIndexChanged"
                                            Width="100px">
                                            <HeaderTemplate>
                                                <div>
                                                    <table cellpadding="0" cellspacing="0">
                                                        <tr align="center">
                                                            <td style="width: 100px;" align="center">
                                                                Código
                                                            </td>
                                                            <td style="width: 100px;" align="center">
                                                                Descripción
                                                            </td>
                                                            <td style="width: 55px;" align="center">
                                                                Trén
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </HeaderTemplate>
                                            <CollapseAnimation Duration="200" Type="OutQuint" />
                                            <ItemTemplate>
                                                <table cellpadding="0" cellspacing="0">
                                                    <tr align="center">
                                                        <td style="width: 100px;" align="center">
                                                            <%# DataBinder.Eval(Container.DataItem, "miItemCode") %>
                                                        </td>
                                                        <td style="width: 100px;" align="center">
                                                            <%# DataBinder.Eval(Container.DataItem, "matDescript") %>
                                                        </td>
                                                        <td style="width: 55px;" align="center">
                                                            <%# DataBinder.Eval(Container.DataItem, "trnDescript")%>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ItemTemplate>
                                        </telerik:RadComboBox>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn DataField="miItemCodeDesc" HeaderText="Material" SortExpression="miItemCodeDesc"
                                    UniqueName="miItemCodeDesc">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem,"miItemCodeDesc")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtCodeDesc" runat="server" ReadOnly="true" Text='<%#Bind("miItemCodeDesc") %>'
                                            Width="100px" />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="miItemObserv" HeaderText="Comentarios" SortExpression="miItemObserv"
                                    UniqueName="miItemObserv" ItemStyle-Width="100px">
                                    <ItemStyle Width="100px"></ItemStyle>
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn DataField="miItemPercent" DataType="System.Decimal" HeaderText="Porcentaje"
                                    SortExpression="miItemPercent" UniqueName="miItemPercent">
                                    <ItemTemplate>
                                        <%#DataBinder.Eval(Container.DataItem,"miItemPercent")%>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtCodePercent" runat="server" Text='<%#Bind("miItemPercent") %>'
                                            Width="50px" />
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmText='<%$ Resources:Localization, btcConfirmDelete %>'
                                    ConfirmDialogType="RadWindow" Text="<%$ Resources:Localization, lblDelete %>"
                                    UniqueName="ButtonColumn">
                                    <ItemStyle CssClass="handCursor" />
                                </telerik:GridButtonColumn>
                            </Columns>
                            <EditFormSettings>
                                <EditColumn UniqueName="EditCommandColumn1">
                                </EditColumn>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <Selecting AllowRowSelect="True" />
                        </ClientSettings>
                    </telerik:RadGrid>
                </td>
            </tr>
        </tbody>
    </table>
    <telerik:RadWindow ID="rwndMI" runat="server" Behaviors="Close" DestroyOnClose="True"
        InitialBehaviors="Close" Modal="True" Height="185px" Width="435px"
        Behavior="Close" InitialBehavior="Close">
        <ContentTemplate>
            <table cellspacing="2.5" class="tblNewFCMI">
                <tfoot>
                    <tr>
                        <td colspan="2" style="text-align: right">
                            <asp:ImageButton ID="ibtOk" runat="server" ImageUrl="~/Img/Update.gif" AlternateText="Guardar" />
                            <asp:ImageButton ID="ibtCancel" runat="server" ImageUrl="~/Img/Cancel.gif" AlternateText="Cancelar"
                                OnClientClick="closeWin(); return false;" />
                        </td>
                    </tr>
                </tfoot>
                <tbody>
                    <tr>
                        <td style="text-align: right">
                            <asp:Literal ID="litNewMI" runat="server" Text="Nueva MI:" />
                        </td>
                        <td style="text-align: left">
                            <asp:TextBox ID="txtNewMI" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Literal ID="litNewMIDesc" runat="server" Text="Descripción:" />
                        </td>
                        <td style="text-align: left">
                            <asp:TextBox ID="txtNewMIDesc" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Literal ID="litTrain" runat="server" Text="Tren:" />
                        </td>
                        <td style="text-align: left">
                            <telerik:RadComboBox ID="rcmbTrain" runat="server" DataSourceID="sdsTrains" DataTextField="trnDescript"
                                DataValueField="PKTrain" />
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">
                            <asp:Literal ID="litBatchSize" runat="server" Text="Tamaño de Lote:" />
                        </td>
                        <td style="text-align: left">
                            <telerik:RadComboBox ID="rcmbBatchSize" runat="server" DataSourceID="sdsBatchSizes"
                                DataTextField="btcSize" DataValueField="PKBatchSize" />
                            <asp:CheckBox ID="chkEditStatus" runat="server" Text="Estado Edición" />
                        </td>
                    </tr>
                </tbody>
            </table>
        </ContentTemplate>
    </telerik:RadWindow>
</asp:Content>

The codebehind that i use to trying to open the radWindows is:

protected void btnNewMI_Click(object sender, EventArgs e)
        {
            rwndMI.VisibleOnPageLoad = true;
        }


Can you help me to solve this.

Kind regards,
Felipe de Jesús Meléndez Valencia

5 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 29 Jun 2011, 11:19 AM
Hello Felipe,

  As far as I can see the button you use is inside an Update panel. This means that only the content within this panel will be sent back to the client after the server-side click, and the RadWindow is outside and will not be updated. What I'd suggest is that you register a startup script that will open the RadWindow on the client. This will also eliminate the need of resetting the VisibleOnPageLoad property if another postback occurs.

For your convenience I modified your code to achieve this behavior. You can find my test page attached as a reference. For more information on this approach please examine the following blog post: http://blogs.telerik.com/supportdept/posts/09-05-05/executing_javascript_function_from_server-side_code.aspx. Please note that I have commented out most of the code so that I can run the page, but that is not relevant to the case.


All the best,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Felipe de Jesús
Top achievements
Rank 1
answered on 30 Jun 2011, 04:23 PM
Hi Marin.

Thank you so much.

Your solution it's all i need. I change the function call RegisterStartupScript, of ScriptManager to ToolkitScriptManager and all works great.

Thanks for your time and attentions.

Regards,
Felipe Meléndez
0
Felipe de Jesús
Top achievements
Rank 1
answered on 09 Aug 2011, 12:07 AM
Hello again.

Now, i have another problem. The click event of the Ok image button inside the ContentTemplate never fires.

Any way I can fix it?

Regards.
Felipe Melendez.
0
Marin Bratanov
Telerik team
answered on 10 Aug 2011, 01:17 PM
Hi Felipe,

  Do you mean the ContentTemplate of the RadWindow or of an UpdatePanel? How exactly do you determine that it does not fire? If you are referring to a RadWindow - is it possible that the button is inside an update panel and thus the effect is simply not carried back to the client and thus only not visible? Also please make sure that there are no client-side click handlers for the button that cancel the postback.

  I have not seen this issue before and if the above conditions are not met I cannot say for certain what the cause for this behavior would be. What I would advise if you are unable to resolve the situation via the above suggestions is that you open a support ticket and send us a simple, runnable page that reproduces this issue so we can investigate it further and see what the root cause is.


Kind regards,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Felipe de Jesús
Top achievements
Rank 1
answered on 11 Aug 2011, 04:53 AM
Hi Marin. Thanks for your time and your answer.

As you can se in the code that i attach in the begin of this thread. My RadWindow it's inside in a ContentPage. And in the MasterPage the ContentPlaceHolder it's inside in a RadAjaxPanel. I search in the forums and i read about the problem with working with the RadWindow inside the UpdatePanel.

So i trying for a test, deleting the RadAjaxManager, RadAjaxLoadingPanel and the RadAjaxPanel from my MasterPage, and i'm sure that i'm cleaning any reference to a client click event for this button, but this issue continues.

Now i trying with and new and empty solution. I spend that correct the problem.

I contact you in a future when i have an answer or a new question.

Thanks for all.

Regards
Felipe Meléndez
Tags
Window
Asked by
Felipe de Jesús
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Felipe de Jesús
Top achievements
Rank 1
Share this question
or