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

radWindow set to Maximized upon open?

10 Answers 2009 Views
Window
This is a migrated thread and some comments may be shown as answers.
Cole
Top achievements
Rank 1
Cole asked on 11 Aug 2008, 05:05 PM

Trying to set the InitialBehaviors to maximize on the radWindow's OnInit event, and when I pop the window, it's not maximized.  Am I missing something?

ASP.NET Code:

<

body>

<form id="frmPageRender" runat="server">

<asp:Panel ID="pnlPageRender" runat="server" OnInit="pnlPageRender_OnInit" Visible="false">

<asp:ScriptManager ID="smPageRender" runat="server" />

<asp:Literal ID="ltlJS" runat="server" Visible="false" />

<asp:Label ID="lblErrMsg" runat="server" Visible="false" />

<asp:Label ID="lblHTML" runat="server" />

<telerik:RadWindowManager ID="rwmPageRender" runat="server" Visible="true" VisibleOnPageLoad="false">

<Windows>

<telerik:RadWindow ID="rwContentItem" runat="server"

Behaviors="Close,Maximize,Move,Pin,Reload,Resize"

DestroyOnClose="true"

Modal="true"

OnClientClose="fWinRefresh"

OnInit="rwContentItem_OnInit"

ReloadOnShow="true"

ShowContentDuringLoad="false"

Skin="WebBlue"

VisibleStatusbar="false"

>

</telerik:RadWindow>

</Windows>

</telerik:RadWindowManager>

</asp:Panel>

<asp:Panel ID="pnlInstructions" runat="server" OnInit="pnlInstructions_OnInit" Visible="false">

<p>This is where the Page Creation instructions go.</p>

</asp:Panel>

</form>

</

body>
---
Here's the code behind for the OnInit:

protected void rwContentItem_OnInit(object sender, EventArgs e)

{

RadWindow rw = (RadWindow)sender;

rw.InitialBehaviors =

WindowBehaviors.Maximize;

}

Thanks in advance!

-cole

10 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 12 Aug 2008, 02:01 PM
Hi Cole,

To show RadWindow initially maximized, you need to set the InitialBehaviors property to Maximize - OnInit cannot be used in this case.


Sincerely yours,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 10 Dec 2008, 08:53 PM
Hi Georgi!
I'm trying to open a maximized window on demand - when a button is clicked; in my context VisibleOnPageLoad is false, InitialBehaviors is WindowBehaviors.Maximize, Behaviors is WindowBehaviors.Maximize | WindowBehaviors.Reload.
Well it's not working untill VisibleOnPageLoad is true...
How can I obtain desired result with VisibleOnPageLoad is false?
Is it possible?
Dan
0
Georgi Tunev
Telerik team
answered on 11 Dec 2008, 03:11 PM
Hello Dan,

InitialBehavior will work only when RadWindow is opened from the server. When opening RadWindow on the client, you need to use the maximize() method.


Regards,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ming Yang
Top achievements
Rank 1
answered on 24 Feb 2009, 09:27 PM
Can you please give an example on how to launch a radwindow from client javascript and make the window maximized?

Thanks
0
Michael
Top achievements
Rank 1
answered on 25 Feb 2009, 09:28 AM
Hi

There is what I have in JavaScript:

function GetWindow() 
    var oWindow = null
    if (window.radWindow) oWindow = window.radWindow; 
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; 
    return oWindow; 
 

function ShowEmbededPage(windowName, address, maximizeWin) 
    try { 
        //Getting rad window manager 
        var oManager = GetRadWindowManager(); 
        var oWnd = oManager.getWindowByName(windowName); 
        if (oWnd == null) { 
            oManager = GetWindow().GetWindowManager(); 
            oWnd = oManager.getWindowByName(windowName); 
        } 
        
        oWnd.setUrl(address); 
        oWnd.setActive();         
        oWnd.show(); 
        if (maximizeWin != null && maximizeWin.toString().toLowerCase() == 'true') { 
            oWnd.maximize();
        } 
    } 
    catch(e) 
    { 
        alert("Write here an error message!"); 
    } 
     
    return false

Hope this is what you need.
0
Shinu
Top achievements
Rank 2
answered on 25 Feb 2009, 09:42 AM
Hi Ming Yang,

There are several functions let you open a RadWindow object from client-side javascript. You can also set the window as maximized by using the method maximize(). See the example.

ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">  
    <Windows>  
        <telerik:RadWindow ID="RadWindow1" runat="server" NavigateUrl="http://www.google.com">  
        </telerik:RadWindow>  
    </Windows>  
</telerik:RadWindowManager> 
<input id="Button1" type="button" value="open new window with maximized" onclick="openwin1();" /> 
<input id="Button2" type="button" value="open existing window with maximized" onclick="openwin2();" /> 

JavaScript:
<script type="text/javascript"
function openwin1() 
     var oWnd = radopen("""RadWindow1"); 
     oWnd.show();   
     oWnd.maximize();  
function openwin2() 
    var oWnd1 = radopen ("http://www.telerik.com"null); 
    oWnd1.maximize()
</script> 

Go through the link for more details about Opening Windows. Also checkout the link for different RadWindow Methods.

Thanks,
Shinu.
0
Fiko
Telerik team
answered on 25 Feb 2009, 03:07 PM
Hello Ming Yang,

Please check this link for more information about opening a new RadWindow. Each of these methods returns a reference to the newly opened RadWindow object and then you could use its maximize() method. For example, bellow I open a RadWindow by using radopen() method. Please note that this method is part of the RadWindowManager control and requires an instance of this control on the page.

The code :

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


Sincerely yours,
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
Ming Yang
Top achievements
Rank 1
answered on 25 Feb 2009, 05:31 PM

Thank you very much for your quick replies. Unfortunately, it still doesn't work for me. Here is my js:

function
ShowDetailForm(id, type)  

 

var win;  

win = window.radopen(

"UMDetails.aspx?RegID=" + id + "&type=" + type, "DetailDialog");  

 

 

win.maximize();  

 

 

return false;  

}

This javascript is called by a button from the radgrid column. The window is shown without problem, but the window is not maximized.

 

0
Michael
Top achievements
Rank 1
answered on 26 Feb 2009, 01:22 PM
Hi Ming

Try to set in code (cs file) <window_object>.Behaviors = WindowBehaviors.Maximize or in window declaration.
Of course you can combine it as you wish, but keep Maximize inside.

Dan
0
Georgi Tunev
Telerik team
answered on 26 Feb 2009, 01:44 PM
Hi Ming Yang,

This code should work and at this point we cannot tell what might be the reason for the problem. Please open a support ticket and send us a small sample project where this issue can be reproduced. Once we have a better view over your setup and logic, we will provide you with the needed solution.


All the best,
Georgi Tunev
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
Cole
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Michael
Top achievements
Rank 1
Ming Yang
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Fiko
Telerik team
Share this question
or