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

Recenter after resize

3 Answers 112 Views
Window
This is a migrated thread and some comments may be shown as answers.
Moon
Top achievements
Rank 2
Moon asked on 21 Aug 2008, 08:30 PM

I set my radwindow height and width in javascript. After I resize it, I'd like to have it recenter. If I resize to a really wide screen, it goes off the right side of the page:
here is a snippet of what I'm doing....

var oWindow = window.radopen(url,radWindowName);

oWindow.SetTitle(title);

if (radWidth != 0)

{

setTimeout(

function()

{

oWindow.setSize(radHeight,radWidth);

}

,0);

}


thanks,
Moon

3 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 22 Aug 2008, 08:40 AM
Hi Moon,

To do this, you need to call RadWindow's center() method:

var oWindow = window.radopen(url,radWindowName); 
oWindow.SetTitle(title); 
if (radWidth != 0) 
    setTimeout( 
    function() 
    { 
        oWindow.setSize(radHeight,radWidth); 
    } 
    ,0); 
oWindow.center(); 


All the best,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Moon
Top achievements
Rank 2
answered on 22 Aug 2008, 02:57 PM
should that be a capital C? cuz I got errors until I tried this:

oWindow.Center();

 

 

0
Georgi Tunev
Telerik team
answered on 25 Aug 2008, 12:11 PM
Hello Moon,

If you are using an older version of the control, you will use the old naming convention and indeed in this case the method will be Center(). Note however that now RadWindow for ASP.NET AJAX uses the new ASP.NET AJAX naming convention and the names of the methods are changed. More information on the subject is available here:

http://www.telerik.com/help/aspnet-ajax/window_overviewchanges.html



Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Moon
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Moon
Top achievements
Rank 2
Share this question
or