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

[Solved] RadWindow moves on its own after opening

5 Answers 139 Views
Window
This is a migrated thread and some comments may be shown as answers.
Casey
Top achievements
Rank 1
Casey asked on 16 Jul 2009, 12:34 PM
Hello,

I have a RadWindow (R2) that opens up from a Link Button on another RadWindow (R1). Through javascript I set the parent window of R2 to the parent of R1 to enable R2 to expand past the bounds of R1. I want R2 to open up maximized in the parent of R1 when the user clicks the link button. I have achieved this to some extent. In R2's page load section of the code behind the page, I set a label equal to a javascript function on R2's html page to maximize the RadWindow: 

 

protected void Page_Load(object sender, EventArgs e)     
{   
    if ((Label1.Text == "<script>CloseWin();</script>")    
        || (Label1.Text == ""))     
    {  
            Label1.Text = "<script>MaximizeWin();</script>";   
    }   
else 
    {    
            Label1.Text = "";     
    }  

 

 

function MaximizeWin() {   
var oWindow = GetRadWindow();   
oWindow.maximize();  
}  
function CloseWin() {    
var oWindow = GetRadWindow();    
oWindow.Close();  
}  
 

This works to maximize R2; however, after I close R2 (setting the label's text equal to a javascript function CloseWin()) and then click the link button again, R2 opens maximized for like half a second and then moves. Instead of the top left corner of R2 being in the top left of the parent page, it is now in the center of the parent page. I'm not sure why this happens when opening R2 as there is another link button on R1 that opens another Radwindow (R3) the same way, and R3 always opens up maximized and never moves after opening. I'm really confused because R3 works fine because I created R2 by copying and pasting everything I used to make R3, with the exception of the NavigateURL's of the RadWindows.

If any more info is needed, please let me know.

Thanks

5 Answers, 1 is accepted

Sort by
0
Casey
Top achievements
Rank 1
answered on 20 Jul 2009, 05:09 PM
Also, when I set a breakpoint on the Page_Load method  the RadWindow appears maximixed every time. Without a breakpoint, I tried wrapping the code in the Page_Load method in an if (!Page.IsPostBack){} statment, to no avail. Also, I upgraded from IE6 to IE8 and the problem still persists. I am using the Q1 2009 version of the Ajax controls.
0
Casey
Top achievements
Rank 1
answered on 21 Jul 2009, 01:08 PM
I was able to get this to work by changing the below:
protected void Page_Load(object sender, EventArgs e)        
{      
    if ((Label1.Text == "<script>CloseWin();</script>")       
        || (Label1.Text == ""))        
    {     
            Label1.Text = "<script>MaximizeWin();</script>";      
    }      
else    
    {       
            Label1.Text = "";        
    }     
}    
 

To the following, and moving the javascript code to maximize the RadWindow to the javascript PageLoad function.

 protected void Page_Load(object sender, EventArgs e)  
    {  
        Label1.Text = "";  
    } 

 

function pageLoad() {      
var oWindow = GetRadWindow();      
oWindow.maximize();     
}   
 

 
The mystery still remains as to why the RadWindow would move on its own while calling the javascript function the way I was earlier.

0
Fiko
Telerik team
answered on 21 Jul 2009, 03:15 PM
Hi Casey,

Unfortunately I was not able to reproduce your scenario. To be able to help you, I need to have a better view over your exact setup and logic. Please open a new support ticket and send me a project that replicates your scenario. Once I receive it, I would have a clearer picture of the windows' behavior and would be able to solve the problem more quickly.

I am looking forward to hearing from you.

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.
0
Casey
Top achievements
Rank 1
answered on 21 Jul 2009, 07:18 PM
Hi Fiko,

I'm not currently added as a licensed developer for my company, so I am unable to open a support ticket at this time. I was not able to duplicate this issue I was experiencing 100%; however, I was able to create a project where the issue occurs the first time the RadWindows are opened, and then works as expected all other times, instead of working the first time and then not working as expected thereafter. While this scenario is not as troublesome as the scenario I am experiencing, it is still annoying.

I'll create a support ticket once I'm a licensed developer, unless there is another way for me to get the project to you. I couldn't find an option to attach the project to my post either.

Thanks,
Casey
0
Fiko
Telerik team
answered on 24 Jul 2009, 12:58 PM
Hello Casey,

We will wait for your support ticket. Please, provide us with the detailed reproduction steps as well.

Greetings,
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
Casey
Top achievements
Rank 1
Answers by
Casey
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or