window position problem when parent not maximized

4 posts, 1 answers
  1. Gillian
    Gillian avatar
    12 posts
    Member since:
    Feb 2008

    Posted 21 May 2009 Link to this post

    Hi,
    We have an html button on a page, which when pressed launches a RadWindow.  If the page containing the html button is not maximized when the button is pressed then only the bottom right corner of the RadWindow is shown in the top left corner of the parent - the top and left of the window are not able to be dragged onto the page - so the window is useless.  Unfortunately I cannot attach a picture, but I hope you understand what I mean.

    If you maximize the parent window before opening the radwindow, the window opens in the centre and works as expected.

    I have tried setting the window to centre, and setting the location with moveTo, but neither works.  Please advise how we can overcome this problem.

    Thank you

    Gillian

    Code for the button and the script to create the RadWindow are below
    HtmlInputButton partAddButton = new HtmlInputButton();  
     
    partAddButton.ID = "uiPartAddButton";  
    partAddButton.Value = "Add A Web Part";  
     
    partAddButton.Attributes.Add("onclick""openWin_" + this.UniqueID + "(); return false;");  
    partAddButton.RenderControl(writer);  
     
    StringBuilder script = new StringBuilder();  
     
    script.Append("<script type=\"text/javascript\">");  
    script.Append("function openWin_" + this.UniqueID + "() {");  
    script.Append("var windowMan = GetRadWindowManager();");  
    script.Append("var windowPane = windowMan.GetWindowByName('uiNewPartsWizard');");  
    script.Append("windowPane.SetUrl('PortalWebPartCatalogPage.aspx?ControlID=" + this.UniqueID + "&ZoneId=" + this.currentZone.PortalPageZoneID.ToString() + "&Scope=" + this.WebPartManager.Personalization.Scope.ToString() + "');");  
                          
    script.Append("windowPane.SetTitle('New Web Part Wizard');");  
     
    script.Append("windowPane.setSize(1000,650);");  
    script.Append("windowPane.Show();}");  
                                      
    script.Append("</script>");  
     
  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 21 May 2009 Link to this post

    Hello Gillian,

    This behavior is the expected one if you use the KeepInScreenBounds property of the RadWindow control with value "true". This property is useful when the opened RadWindow has size greater than the size of the browser's window. If you use that property, the RadWindow's control buttons(on the upper-right corner) will be always visible.
    You can avoid the behavior that you currently experience, by using one of the followings approaches:
    • set the KeepInScreenBounds to "false". Please note that in this case the RadWindow's control buttons may become invisible.
    • reduce the size of the opened RadWindow control

    I hope this helps.

    Kind regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Gillian
    Gillian avatar
    12 posts
    Member since:
    Feb 2008

    Posted 21 May 2009 Link to this post

    Hi Fiko,
    How would I apply that property from the client side?  I have tried adding 

    script.Append(

    "windowPane.KeepInScreenBounds=false;");

    after the setSize row - but it has made no difference.

    Thank you

    Gillian

     

  4. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 21 May 2009 Link to this post

    Hi Gillian,

    On the client-side you need to use the windowPane.set_keepInScreenBounds(false); function in order to disable that behavior. The get_keepInScreenBounds() function returns whether that behavior is enabled, respectively.

    I hope this helps.

    All the best,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top