Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
149 views
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

Felipe de Jesús
Top achievements
Rank 1
 answered on 11 Aug 2011
0 answers
134 views
UPDATE: This thread can be deleted. I deployed to another environment and things seem to be working fine. I suspect this was cache-related, even though I cleared Chrome a number of times... 

Hi,

I'm not sure if this should be in this forum or the RadSkinManager one, but I'm using the RadStyleSheetManager so here goes.

I have a working custom theme (generated with the Visual Style Builder, stored in App_Themes/CustomSkin). I declare it in the web.config (<add key="Telerik.Skin" value="CustomSkin" />)


I have two pages: ~/index.aspx and ~/Pages/search.aspx (both pages are identical except for their respective directories)

Both use the same master page (~/_MasterPages/Base.Master)

Both inherit from the same base page (where I set the theme in OnPreInit: Theme = "CustomSkin";)


The theme is applied correctly to ~/index.aspx in Firefox, IE, and Chrome

However, the theme is only applied to ~/Pages/search.aspx in Firefox and IE, NOT in Chrome.

Chrome doesn't fire any errors in the console, so I'm really not sure what's going on.


Are there any known issues or workarounds for the Chrome browser? Any suggestions?

Thanks a lot,
Rob
Rob sherwood
Top achievements
Rank 1
 asked on 11 Aug 2011
4 answers
155 views

How to bind the GridDropDownColumn from code behind. Need help ASAP.

Eva
Top achievements
Rank 1
 answered on 11 Aug 2011
2 answers
165 views
Hi,

I am using two Comboxes in FilterTemplates in my grid in the following code. The filtering for "Priority" works just as intended, no issues or anything. It is the filtering for the  "visdrop" column that I am having trouble with. That data is bool and when I select True/False, it does in fact filter correctly. But when I try to select the "blank" option in the Combobox to remove the filter, the filter remains and the Combobox returns to its previous selection. What am I missing?

The Code:
<telerik:RadGrid ID="_rgProjectNews" runat="server" AllowPaging="True" OnNeedDataSource="rgProjectNews_NeedDataSource"
        CssClass="mainInnerContent" OnItemCommand="rgProjectNews_ItemCommand" OnItemDataBound="rgProjectNews_ItemDataBound"
        Skin="Office2007" AllowFilteringByColumn="true">
        <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="None" ClientDataKeyNames="Id">
            <Columns>
                <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="TemplateEditColumn"
                    HeaderStyle-Width="25px">
                    <ItemTemplate>
                        <asp:ImageButton ID="_imgEdit" runat="server" ImageUrl="~/Theme/Img/Icons/page_edit.png"
                            ToolTip="Edit" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" HeaderText="Id" SortExpression="Id"
                    UniqueName="Id" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="subject" HeaderText="Subject" SortExpression="subject"
                    UniqueName="subject" FilterControlWidth="95%">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="visdrop" HeaderText="Visible" HeaderStyle-Width="50px">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="_filtVisible" Width="50px" SelectedValue='<%# Container.OwnerTableView.GetColumn("VisibleCol").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="VisibleIndexChangedStatus">
                            <Items>
                                <telerik:RadComboBoxItem Text="" Value="" />
                                <telerik:RadComboBoxItem Text="Yes" Value="True" />
                                <telerik:RadComboBoxItem Text="No" Value="False" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="_scriptT" runat="server">
 
                            <script type="text/javascript">
                                function VisibleIndexChangedStatus(sender, args) {
                                    var tableView = $find("<%# Container.OwnerTableView.ClientID %>");
                                    tableView.filter("VisibleCol", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
 
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                    <ItemTemplate>
                        <telerik:RadComboBox ID="_cbVis" runat="server" Width="50px" SelectedValue='<%# Eval("Visible") %>'
                            OnSelectedIndexChanged="CbVisSelectedIndexChanged" AutoPostBack="True">
                            <Items>
                                <telerik:RadComboBoxItem Text="Yes" Value="True" />
                                <telerik:RadComboBoxItem Text="No" Value="False" />
                            </Items>
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="Visible" HeaderText="Visible" UniqueName="VisibleCol"
                    Display="false">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="Priority" UniqueName="Priority" HeaderStyle-Width="75px">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="_filtPriority" Width="70px" SelectedValue='<%# Container.OwnerTableView.GetColumn("PriorityReal").CurrentFilterValue %>'
                            runat="server" OnClientSelectedIndexChanged="SelectedIndexChangedStatus">
                            <Items>
                                <telerik:RadComboBoxItem Text="" Value="" />
                                <telerik:RadComboBoxItem Text="Urgent" Value="1" />
                                <telerik:RadComboBoxItem Text="High" Value="2" />
                                <telerik:RadComboBoxItem Text="Normal" Value="3" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="_scriptS" runat="server">
 
                            <script type="text/javascript">
                                function SelectedIndexChangedStatus(sender, args) {
                                    var tableView = $find("<%# Container.OwnerTableView.ClientID %>");
                                    tableView.filter("PriorityReal", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
 
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                    <ItemTemplate>
                        <telerik:RadComboBox ID="cbPriority" Width="70px" SelectedValue='<%# Eval("Priority") %>'
                            runat="server" OnSelectedIndexChanged="PrioritySelectedIndexChanged" AutoPostBack="True">
                            <Items>
                                <telerik:RadComboBoxItem Text="Urgent" Value="1" />
                                <telerik:RadComboBoxItem Text="High" Value="2" />
                                <telerik:RadComboBoxItem Text="Normal" Value="3" />
                            </Items>
                        </telerik:RadComboBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="Priority" HeaderText="PriorityReal" UniqueName="PriorityReal"
                    Display="false">
                </telerik:GridBoundColumn>
                <telerik:GridDateTimeColumn DataField="LastModified" DataFormatString="{0:dd/MM/yyyy h:mm tt}"
                    HeaderText="Last Modified" HeaderStyle-Width="76px" UniqueName="LastModified"
                    AllowFiltering="false">
                </telerik:GridDateTimeColumn>
                <telerik:GridTemplateColumn UniqueName="deleteColumn" Groupable="False" HeaderStyle-Width="25px"
                    AllowFiltering="false">
                    <ItemTemplate>
                        <asp:ImageButton ID="_imgBtnDelete" CommandArgument='<%# Eval("Id") %>' CommandName="Delete"
                            OnClientClick="return confirm('Are you sure you want to delete this record?');"
                            ImageUrl="~/Theme/Img/Icons/cross.png" ToolTip="Delete" runat="server"></asp:ImageButton>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="place" UniqueName="place2" Visible="False">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings ClientEvents-OnRowDblClick="RowDblClick">
        </ClientSettings>
    </telerik:RadGrid>
Stephen
Top achievements
Rank 1
 answered on 11 Aug 2011
20 answers
1.8K+ views
hiya,
I have successfully downloaded and been able to run the Prometheus samples.

I now want to develop in my own individual apps on the same machine.

I have:
1) an existing folder of radControls in my app
2) referenced the Telerik.Web.UI.dll

When I try to run my app, I get the following error:

<< The type 'System.Web.UI.IScriptControl' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.>>

I can only assume that this is a webConfig error.
How can I solve it?

Is there a guide that will quickly tell me what I need to do in addition to the steps that I have already taken?I just want to get up and running asap.

Many thanks,

yogi

Josh
Top achievements
Rank 1
 answered on 10 Aug 2011
1 answer
150 views
Hi,

we're using RadEditor to edit various html contents in our project. Our requirement is this: We have certain pages with html templates, where the html structure should not change. Only the content (text images etc) should be changed by the users. The problem we have is that some html templates are not full html pages but only internal parts of pages, and they might have structures like

<!-- top image starts -->
<tr>
    <td align="center" valign="top" colspan="3">
        <table width="620" align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0">
...

i.e. the html starts with <tr> or some other tags which should not be the outermost tags in html. What we've observed is that RadEditor changes this html into this:

        <table width="620" align="center" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0">
...

It strips the <tr> and <td> tags and only leaves the <table> tag. We need RadEditor to leave the whole html as it is and not make any changes at all. I've searched the interwebs and checked the RadEditor documentation but I can't find any parameter for RadEditor which does this. Can we have RadEditor leave the html untouched or do we have to find another editor for this purpose?

Best,

Taylan
Rumen
Telerik team
 answered on 10 Aug 2011
1 answer
71 views
I am using two instances of RadEditor to provide the user the ability to "wrap" content within two blocks of html. For example:

Enter HTML TOP (RadEditor)

{content from db}

Enter HTML BOTTOM (RadEditor)

In this way, content from the database is contained in a pretty html template. The problem occurs when you try to put an opening tag inside the HTML TOP and then its closing tag in the HTML BOTTOM (such as a <DIV>).

For instnace, if I place a "<DIV>" in the HTML TOP and a closing "</DIV>" in the HTML BOTTOM what i end up with is "<DIV></DIV>" in the HTML TOP and the "</DIV>" in the HTML BOTTOM is removed. 

Is there a way to turn this auto-correcting feature off? I am 
using the ContentFilters="None" in the declaratively markup but it still does this intrinsic validation.

Rumen
Telerik team
 answered on 10 Aug 2011
3 answers
70 views
Hi every one.

I had Telerik 2009 before, and now i update it to 2011.
i have some projects in 2009 and i Change one of them to telerik 2011 manualy.(I Deleted Telerik.Web.UI.dll From BIn and refrences and Put one component in one page that made 2011 DLL and then i add id to refrence manualy from bin folder)

And now i have some problem. first of all ,When i make new Project and put RadEditor in it , it is ok in all browsers. but in my previews project that i converted them to 2011 from 2009 , it dont have toolItems in above of it in Google Chrome.(but it is okin IE and Firefox).

Is it the better way to convert projects to new Telerik? , and is it a way for my edtor to be ok in Chrome in converted projects?

Thanks in advance.
Rumen
Telerik team
 answered on 10 Aug 2011
1 answer
102 views
Hi all,

We have a very curious layout bug in one of our pages.
We have a grid with grouping that on certain undefined circumstances is shrinked and displayed within the half of the page (see screenshot)

The collegue that did this page (and is currently not in the project any more) wanted the groups to be collapsed initially and wrote a function that goes like this:


function CollapseAll(event) {
    var tableView = $find('<%=RadGrid1.ClientID %>').get_masterTableView();
    var rows = tableView.get_element().rows;
    for (var i = 0, len = tableView.get_element().rows.length; i < len; i++) {
        var button = tableView._getGroupExpandButton(rows[i]);
        if (button) {
            var groupLevel = button.id.split("__")[2];
            if (groupLevel == 0) {
                tableView._toggleGroupsExpand(button, event);
            }
        }
    }
}

We have tried to turn off the function, but it still is displayed the same way. 
When testing local - it works fine.

Any help regarding this will be very appreciated.

Thank in advance!
 
Pavlina
Telerik team
 answered on 10 Aug 2011
1 answer
164 views
Hi
I have a problem, and describing it might be little complicated.
I have 3 different type of a Web-mail layout:
  1. Preview pane on the right.
  2. Preview pane at the bottom.
  3. Disabled Preview pane.

My problem is like that: My pagination panel gets positioned wrong.
I have a splitters layout (web mail like) with titles, that are presented in the page using aspPanels.
These titles hurts the calculations of the splitter, and as a result the pagination bar get positioned wrong.
But in one layout of the screens - Bottom, the pagination bar gets positioned ok. It doesn't in two screens that have the same login - they r vertical. (please see attached files. The correct one is "at the bottom")

My .Net code is:
<div class="wrapper">
<telerik:RadSplitter ID="rsptMain" Runat="server" Skin="sunsetGreen" EnableAjaxSkinRendering="true" EnableEmbeddedSkins="false"  Width="100%" Height="100%" VisibleDuringInit="false">
    <telerik:RadPane ID="foldersPane" runat="server" Width="250" Height="100%" Scrolling="None">
        <telerik:RadSplitter ID="RadSplitter1" Runat="server" Skin="sunsetGreen" EnableEmbeddedSkins="false" EnableAjaxSkinRendering="true" EnableEmbeddedBaseStylesheet="false" Height="100%" Orientation="Horizontal" VisibleDuringInit="false">
            <telerik:RadPane ID="FolderTreePane" Width="250" runat="server" Scrolling="None">
                        <h2 class="PageLeftMainTitle" id="PageLeftMainTitle">Curriculus</h2>
                        <telerik:RadTreeView>........</telerik:RadTreeView>
            </telerik:RadPane>
                    <telerik:RadSplitBar ID="FolderPaneSplitBar" runat="server" CollapseMode="Backward" EnableResize="False" ></telerik:RadSplitBar>
                    <telerik:RadPane Width="250" Height="90" ID="BottomLeftMenuPane" runat="server" Scrolling="None" OnClientCollapsed="BottomLeftMenuPaneToggled" OnClientExpanded="BottomLeftMenuPaneToggled">
                        <uc1:BottomLeftMenu ID="BottomLeftMenu" runat="server" />
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="foldersSplitBar" runat="server" CollapseMode="Forward"></telerik:RadSplitBar>
            <telerik:RadPane ID="curriculumPane" runat="server" Height="100%" Scrolling=None>
<asp:Panel ID="pFolderInfoGrid" CssClass="CurriculusGridTitleEMenu" runat="server">
                    <h2>
                        <asp:Literal ID="ltFolderName" runat="server" Text="Todos filtros juntos"></asp:Literal>
                    </h2>
                    <div class="PainelDeLeitura" id="PainelDeLeituraButton">
                        <span class="subMenuTitle" onclick="ShowColumnHeaderMenu(event,'ReadPainel')">
                            <span>Painel de Leitura</span>
                        </span>
                    </div>
                </asp:Panel>
                <telerik:RadSplitter ID="rsptMainCurriculum" Runat="server" Skin="sunsetGreen" EnableAjaxSkinRendering="true" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" Width="100%" Height="100%" Orientation="Horizontal">
                    <telerik:RadPane ID="curriculumListPane" runat="server" CssClass="curriculumListPane" runat="server" Height="100%" Scrolling="None">
                        <telerik:RadGrid ID="rgridCurriculum" CssClass="rgridCurriculum" runat="server" AllowSorting="true" AllowPaging="true" PageSize="10" ViewStateMode="Enabled" OnNeedDataSource="rgridCurriculum_NeedDataSource" OnItemDataBound="rgridCurriculum_ItemDataBound" AllowMultiRowSelection="true" OnRowDrop="rgridCurriculum_RowDrop" Skin="sunsetGreen" EnableEmbeddedSkins="false" Height="100%">
                            <PagerStyle  Mode="NextPrevAndNumeric" />
                            <MasterTableView AutoGenerateColumns="false" DataKeyNames="Code" AllowPaging="true" TableLayout="Fixed">...........
                            </MasterTableView>
                            <ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true" EnablePostBackOnRowClick="false">
                                <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
                                <ClientEvents OnRowDropping="rgridCurriculum_OnRowDropping" />
                                <ClientEvents OnRowDblClick="rgridCurriculum_OnRowDblClick" />
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            </ClientSettings>
                        </telerik:RadGrid>
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="curriculumSplitBar" runat="server" CollapseMode="Forward" Visible="false"></telerik:RadSplitBar>
                    <telerik:RadPane ID="curriculumViewPane" runat="server" Visible="false"></telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
        </telerik:RadSplitter>
</div>

My code block readability is terrible. I tried removing unnecessary parts from it.
the thing is that my asp:panel is inside the telerik:RadPane that has 100% and is holding the main big vertical splitter, and than under it the telerik:RadSplitter appears.

it looks like that
<telerik:RadPane
   <asp:Panel
   <telerik:RadSplitter

In the "at the bottom" everything works fine. The splitter calculate the height without the AspPanel height. But in the "on the right" & "disabled" screen it joins them.

Why? The order of my DOM is equall in the 3 files. What can create this difference?

I hope I was clear, and I hope my code was some how readable :)

Thanks for any help.
Shlomi.
Dobromir
Telerik team
 answered on 10 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?