9 Answers, 1 is accepted
I believe that the following forum thread will be of help:
http://www.telerik.com/community/forums/aspnet-ajax/window/is-there-a-window-onmaximize-event.aspx
Sincerely yours,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

I apologize for not providing a full code sample in my previous reply. Here is how to get the size - you need to get the height and width of the popup element after the resize. Also please note that the OnClientCommand handler must be placed in the parent page:
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<script type="text/javascript" language="javascript"> |
function openWin() |
{ |
var oWnd = $find("<%= rwDialog.ClientID %>"); |
oWnd.show(); |
} |
function OnClientCommand(sender,args) |
{ |
if(args.get_commandName() == "Maximize") |
{ |
window.setTimeout(function() |
{ |
var senderElementStyle = sender.get_popupElement().style; |
alert(senderElementStyle.width + " " + senderElementStyle.height); |
}, 0); |
} |
} |
</script> |
<telerik:RadWindow |
ID="rwDialog" |
runat="server" |
NavigateUrl="Dialog.aspx" |
OnClientCommand="OnClientCommand" |
> |
</telerik:RadWindow> |
<button id="showDialog" onclick="openWin(); return false;"> |
Show Dialog</button> |
If you want to get the size in the parent page, your code should look like this:
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<script type="text/javascript" language="javascript"> |
function openWin() |
{ |
var oWnd = $find("<%= rwDialog.ClientID %>"); |
oWnd.show(); |
} |
function OnClientCommand(sender,args) |
{ |
if(args.get_commandName() == "Maximize") |
{ |
//call a function in the content page |
sender.get_contentFrame().contentWindow.secondFn(); |
} |
} |
</script> |
<telerik:RadWindow |
ID="rwDialog" |
runat="server" |
NavigateUrl="Dialog.aspx" |
OnClientCommand="OnClientCommand" |
> |
</telerik:RadWindow> |
<button id="showDialog" onclick="openWin(); return false;"> |
Show Dialog</button> |
</form> |
and in the content page:
function GetRadWindow() |
{ |
var oWindow = null; |
if (window.radWindow) oWindow = window.radWindow; |
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; |
return oWindow; |
} |
function secondFn() |
{ |
window.setTimeout(function() |
{ |
var senderElementStyle = GetRadWindow().get_popupElement().style; |
alert(senderElementStyle.width + " " + senderElementStyle.height); |
}, 0); |
} |
All the best,
Georgi Tunev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.


Thank you for your code, it was very useful.
But I still have a problem with using the width and height values in the c# code, in other words, after I open the maximized radwindow, I need to get the width and height in pixels and use them in the c# code (Page_Load method),
Plaese, look at the following code:
"
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head id="Head1" runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.RadWindow;
//Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow;
//IE (and Moz as well)
return oWindow;
}
function GetRadWindowWidth() {
var senderElementStyle = GetRadWindow().get_popupElement().style;
var _width = senderElementStyle.width.toString();
document.all(
'Label2').innerHTML = _width;
}
 
</script>
<style type="text/css">
#CMapPanel {position:absolute; }
#content {position:relative; z-index:2;}
#LayerPanel1 {position:relative; z-index:1;}
</style>
<script type="text/javascript">
function OnClientInitialize(dock, args) {
var divMap = $get("CMapPanel");
divMap.appendChild(dock.get_element());
}
</script>
</
head>
<
body onload="GetRadWindowWidth()">
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Panel ID="Panel2" Width="100%" Height="100%" runat="server" >
<asp:Panel ID="CMapPanel" Height="100%" Width="100%" runat="server" >
<asp:Image ID="CMapImage" runat="server" />
</asp:Panel>
<asp:Panel ID="LayerPanel1" Width="100%" runat="server">
<telerik:RadDockLayout ID="RadDockLayout1" runat="server">
</telerik:RadDockLayout>
</asp:Panel>
<asp:Panel ID="content" Width="100%" Height="60px" runat="server">
<asp:Label ID="Label2" runat="server" Visible="true" Text="Label"></asp:Label>
<asp:Label ID="Label3" runat="server" Visible="true" Text="Label"></asp:Label>
</asp:Panel>
</asp:Panel>
</div>
</form>
</
body>
</
html>
"
For now, the "Label2" gets the value of "1024px" , but if I try to set that value for "Label3", then the Label3 will get the value string.Empty.
"
protected
void Page_Load(object sender, EventArgs e)
{
Label3.Text = Label2.Text.ToString();
}
It is very important to handle the returned value of width in the Page_Load method
Please, what is wrong with the above code.
it is apprecited to send me the modified code with an explaination,.
Regards,
Bader
The reason for the problem is in the way you built the logic. The asp:label element is rendered as a standard SPAN and will not work for such scenarios - this issue is not related to our controls in any way. More information on the subject is available in various resources on the Net.
What I would suggest is to use a hidden field.
e.g.
<
head
runat
=
"server"
>
<
title
></
title
>
<
script
runat
=
"server"
>
protected void Page_Load(object sender, EventArgs e)
{
Label2.Text = HiddenField1.Value;
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
></
asp:Label
>
<
asp:HiddenField
ID
=
"HiddenField1"
runat
=
"server"
/>
<
asp:Label
ID
=
"Label2"
runat
=
"server"
></
asp:Label
>
<
button
onclick
=
"setValue(); return false;"
>
set value in label1</
button
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Submit"
/>
<
script
type
=
"text/javascript"
>
function setValue()
{
var _width = "500"
var label2 = document.getElementById("<%= HiddenField1.ClientID %>");
label2.value = _width;
}
</
script
>
</
form
>
</
body
>
</
html
>
Kind regards,
Georgi Tunev
the Telerik team

Thank you very much for your code, it was useful but unforunatily it is not solving my issue,
I have searched for a good resources in order to handle this issue but I didn't find any thing good.
All I need is to get the radwindow width (or height) immediately using the Page_Load method, without clicking the following buttons:
<
button
onclick
=
"setValue(); return false;"
>
set value in label1</
button
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Submit"
/>
Please, I need your help, I'm stuck here in this point.
It is appreciated to send me the modified code.
Regards,
Bader

I havn't recieve any reply yet regarding the above issue.
"
All I need is to get the radwindow width (or height) immediately using the Page_Load method, without clicking the following buttons:
<
button
onclick
=
"setValue(); return false;"
>
set value in label1</
button
>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
Text
=
"Submit"
/>
"
Please, I need your help, I'm stuck here in this point.
It is appreciated to send me the modified code.
Regards,
Bader

Please refer to http://www.telerik.com/community/forums/aspnet-ajax/window/get-radwindow-height-using-code-behind.aspx
Regards,
Bader