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

Resizing RadWindow within a master page

3 Answers 75 Views
Window
This is a migrated thread and some comments may be shown as answers.
CBARS
Top achievements
Rank 2
CBARS asked on 18 Jun 2009, 08:54 AM
Hi,

I have a RadWindow on a page that gets put into a contentplaceholder on a master page. Is there any way to make the Window open at position 0,0 of the master page?

3 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 18 Jun 2009, 10:31 AM
Hi CBARS,

Yes, this is possible and I recommend you use the following approach :

<script type="text/javascript"
    function openRadWindow() 
    { 
        var oWindow = window.radopen("http://www.telerik.com""RadWindow1"); 
        oWindow.moveTo(0, 0); 
    } 
</script> 

Every time when a RadWindow is opened it will positioned to the top-left corner of the browser window. For your convenience I have attached a full demo to the thread.

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.
0
CBARS
Top achievements
Rank 2
answered on 18 Jun 2009, 11:12 AM
Hi Fiko,

Thanks for your speedy response.

I have put the MoveWindow function in the OnClientShow event as i need server side code to execute first. So instead I used the GetRadWindow function to identify the window and the MoveWindow function to move it, however it doesn't work and i get and Object Required error. I'm sure I'm making a silly mistake, any further help would be greatly appreciated.

function GetRadWindow()
    {
        var oWindow = null;
        if (window.radWindow) oWindow = window.radWindow;
        else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
            
        return oWindow;
    }
    
    function MoveWindow()
    {
        var oWindow = GetRadWindow();
        oWindow.moveTo(0, 0);
    }
0
Accepted
Fiko
Telerik team
answered on 18 Jun 2009, 02:13 PM
Hi CBARS,

The GetRadWindow() function is used in order to get reference to the RadWindow object on the page that is opened in a RadWindow and contains that function's declaration. That is why, in your scenario the GetRadWndow() function returns 'null' and this is expected, because the page is not opened inside a RadWindow object. In your case you need to use the following approach :

<script type="text/javascript"
    function OnClientShow(oWindow, args) 
    { 
        oWindow.moveTo(0, 0); 
    } 
</script> 

The first passed argument to the OnClientShow handler is the caller object ( RadWindow object).

I hope this helps.

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
CBARS
Top achievements
Rank 2
Answers by
Fiko
Telerik team
CBARS
Top achievements
Rank 2
Share this question
or