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

2 User controls with Radwindow on same page

2 Answers 161 Views
Window
This is a migrated thread and some comments may be shown as answers.
Geoff
Top achievements
Rank 1
Geoff asked on 20 Sep 2012, 02:19 PM
I have 2 controls on my page that both have a RadWindowManager and RadWindow, each with their specified settings. Through searching, it looks like you can designate the RadWindowManager via client side code, but I am unable to get it to work. The last read in RadWindowManager still keeps the settings for both.

Here is my first .ascx control.

<telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    Behaviors="Close" Animation="Slide" Modal="True"
KeepInScreenBounds="True" AutoSize="True" Width="870px" Behavior="Close">
    <Windows>
        <telerik:RadWindow ID="PopUp" runat="server"
            NavigateUrl="/Controls/ProductPopUpPage.aspx?GUID="
            IconUrl="/Images/JJIcon16x16.jpg">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>
<script type="text/javascript">
    // RadWindow
    function ShowProductPopUp(ProductGuid) {
        var oManager = GetRadWindowManager("RadWindowManager1");
        oManager.open("/Controls/ProductPopUpPage.aspx?GUID="+ProductGuid, "PopUp");
    }
 
 
</script>


And my second .ascx control

<div style="padding-left: 10px;">
    <asp:DropDownList ID="OEDropDownList" Width="200" Font-Size="Medium" runat="server">
        <asp:ListItem> Create a New Order</asp:ListItem>
        <asp:ListItem> View Pending Orders</asp:ListItem>
        <asp:ListItem> View Previous Orders</asp:ListItem>
    </asp:DropDownList>
    <div style="float: right;">
        <asp:Button ID="CreateNewOrder" Text="Create New Order" OnClientClick="openWinContentTemplate(); return false;"
            runat="server" />
    </div>
</div>
<%--<telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> Comment back in for single test page--%>
<telerik:RadWindowManager ID="CreateNewOrderWindowManager" runat="server"
    EnableShadow="True">
    <Windows>
        <telerik:RadWindow runat="server" ID="CreateNewOrderPopUpWindow" Modal="true"
            Width="350px" Height="150px" RestrictionZoneID="ContentTemplateZone"
            Animation="Fade" IconUrl="/Images/JJIcon16x16.jpg">
            <ContentTemplate>
                <asp:Panel ID="CreateNewOrderPanel" runat="server" Width="300px" Height="100px" BackColor="AliceBlue"
                    BorderWidth="1px">
                    <asp:Label ID="CreateNewOrderLabel" runat="server" Text="Enter Order Name" />
                    <asp:TextBox ID="CreateNewOrderAddTextBox" runat="server" Width="200px" Text="Enter Order Name" />
                    <asp:Button ID="CreateNewOrderAddButton" runat="server" Text="Create" />
                </asp:Panel>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<script type="text/javascript">
 
    function openWinContentTemplate() {
        var oManager = GetRadWindowManager();
        oManager.open(null, "CreateNewOrderPopUpWindow");
 
 
 
    }
     
</script>

I've tried adding the RadWindowManager client ID into both with no success.


2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 21 Sep 2012, 11:45 AM
Hello Geoff,

Have you examined this help article that explains how to treat this scenario: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-wrong-window-opened.html? Applying the approach advised there and making sure I have proper references by using $find() results in the expected behavior on my end. You can find a simple example based on your snippets attached, along with a flash video that shows the proper behavior (e.g. the Behaviors of the RadWindows are correct, which reminds me that the property to be used is Behaviors and not Behavior). In case you have multiple instances of these user controls on the same page you may find useful this KB article.


Regards,
Marin Bratanov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Geoff
Top achievements
Rank 1
answered on 21 Sep 2012, 01:10 PM
Great! Thank you. I see how the Javascript finds the window now. Works perfect!
Tags
Window
Asked by
Geoff
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Geoff
Top achievements
Rank 1
Share this question
or