all radwindow children reloading when a new one is created

5 posts, 0 answers
  1. Mike
    Mike avatar
    9 posts
    Member since:
    Nov 2013

    Posted 19 Jan 2014 Link to this post

    I have a radwindow manager that I am programatically adding windows too. The user may have 5 or 6 open at a time. But when I add a new one using the windows.add method it reloads all the children into the center of the screen one on top of the other. Is there anyway to just add a new window without the children that are already open being touched?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Jan 2014 Link to this post

    Hi Mike,

    I guess you want to open Multiple RadWindow on same RadWindowManager. Please have a look into the following code snippet which works fine at my end.

    <telerik:RadButton ID="Button1" runat="server" Text="OpenNewWindow" OnClick="Button1_Click">
    <telerik:RadWindowManager ID="RadWindowmanager1" runat="server">

    protected void Page_Init(object sender, EventArgs e)
        RadWindow win = new RadWindow();
        win.ID = "Win1";
        win.Title = "Window1";
        win.VisibleOnPageLoad = true;
    protected void Button1_Click(object sender, EventArgs e)
        RadWindow win1 = new RadWindow();
        win1.ID = "Win2";
        win1.Title = "Window2";
        win1.VisibleOnPageLoad = true;

    Please provide your code if it doesn't help.
  3. Mike
    Mike avatar
    9 posts
    Member since:
    Nov 2013

    Posted 20 Jan 2014 Link to this post

    Shinu, Thank you for your reply.
    However opening multiple windows is not the issue.
    Getting the first one to maintain its position and URL is. When you open the second window the first one reloads its contents and repositions itself behind the second one. How do I maintain state on the first window? I don't want it to move or reload.
  4. Mike
    Mike avatar
    9 posts
    Member since:
    Nov 2013

    Posted 20 Jan 2014 Link to this post

    Here is a small code sample showing the problem.
    Each button click loads a new window but all previous windows are reloaded. This is the behavior I wish to avoid.

    <html xmlns="">
    <head runat="server">
        <form id="form1" runat="server">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                    <telerik:AjaxSetting AjaxControlID="Button1">
                            <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
            <telerik:RadWindowManager ID="RadWindowManager1" runat="server" PreserveClientState="True"></telerik:RadWindowManager>
            <asp:Button ID="Button1" runat="server" Text="Button" />

    Button Click:
    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
           Dim radw As New RadWindow
            radw.ID = System.DateTime.Now.ToString
            radw.NavigateUrl = ""
            radw.VisibleOnPageLoad = True
            radw.BorderStyle = BorderStyle.None
            radw.BorderWidth = 1
            radw.VisibleTitlebar = True
            radw.Modal = False
            radw.VisibleStatusbar = False
            radw.EnableViewState = True
            radw.ReloadOnShow = False

            radw.Height = 380
            radw.Width = 600
            radw.Title = " Chat Room"

            radw.Behaviors = WindowBehaviors.Move Or WindowBehaviors.Resize

        End Sub
  5. Marin Bratanov
    Marin Bratanov avatar
    3908 posts

    Posted 20 Jan 2014 Link to this post

    Hi guys,

    A RadWindow creates its popup with JavaScript, i.e., when it is opened in the browser. Thus, a postback will dispose this HTML and the RadWindow will close. After the postback is received in the browser a new RadWindow will be generated and it will start from the center.
    This is the expected behavior with this code.

    What I advise is that you open the dialogs with JavaScript only: This will have the following benefits:
    - you will not need to recreate server controls with each postback (as ASP requires for all dynamic controls)
    - you will can avoid unnecessary postbacks
    - without disposing the page (or, at least, the RadWIndowManager), the popups can keep their position and state even if other partial postbacks occur on the page.

    RadWindowManager lets you create RadWindow instances dynamically with JavaScript, and then you can use the client-side API of the cotnrol to set needed properties (hide statusbar, set dimensions and position, etc.):

    If you need to get information from the server (e.g., the URL) I advise you examine this article to see how you can register a script that will do the job, so you can avoid disposing the RadWIndowManager: Thus, you can only pass an URL (and other parameters, if needed), to a function already created in the markup that will open the dialogs and set needed properties.

    Alternatively, if you can declare the RadWindows in the RadWindowManager markup, you can try setting the PreserveClientState property of the manager to true. It will attempt to store the current bounds and size of the windows from the manager's collection to a cookie, but it is legacy functionality that may have issues. You can also consider using custom storage settings, as shown in this demo:

    Marin Bratanov
    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 the blog feed now.
Back to Top