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

window position problem when parent not maximized

3 Answers 64 Views
Window
This is a migrated thread and some comments may be shown as answers.
Gillian
Top achievements
Rank 1
Gillian asked on 21 May 2009, 07:47 AM
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>");  
 

3 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 21 May 2009, 01:54 PM
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.
0
Gillian
Top achievements
Rank 1
answered on 21 May 2009, 02:16 PM
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

 

0
Accepted
Fiko
Telerik team
answered on 21 May 2009, 02:53 PM
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.
Tags
Window
Asked by
Gillian
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Gillian
Top achievements
Rank 1
Share this question
or