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
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.
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
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.
Thanks
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.
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.
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.
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.
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
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.