Hello All,
We have used "autosize=true" for radwindow, but the radwindow is not getting autosized after the content on the page changes instead the horizontal and vertical scrollbars are coming. We are using AjaxPanel.
As you have specified that "The size of the content page is taken in window.onload. This means that if you change the size of the content page with Ajax, the RadWindow will not resize after the new content is displayed.".
Can you please tell us know where the problem is?
We have also tried with the following code on the Page_Load(). It is helping in autosizing, but on the continuous button clicks the size of the rad window grows horizontally till the end of the browser reaches.
#region RadWindow AutoSize
public void EnableRadWindowAutoSize(RadAjaxPanel radAjaxPanel, Label messageLabel)
{
radAjaxPanel.Controls.Add(SetRadWindowSizeRadScriptBlock(messageLabel));
}
public void EnableRadWindowAutoSize(RadAjaxManager radAjaxManager, Label messageLabel)
{
radAjaxManager.Controls.Add(SetRadWindowSizeRadScriptBlock(messageLabel));
}
private RadScriptBlock SetRadWindowSizeRadScriptBlock(Label messageLabel)
{
RadScriptBlock radScriptBlock = new RadScriptBlock();
System.Text.StringBuilder scriptContent = new System.Text.StringBuilder();
scriptContent.Append(@"
<script type='text/javascript'>
function SetRadWindowSize(messageLabelID)
{
try
{
var messageLabel = document.getElementById(messageLabelID);
if (messageLabel)
{
if (messageLabel.innerHTML.length > 0)
{
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 az well)
oWindow.autoSize();
}
}
}
catch (ex){}
}");
scriptContent.Append(String.Format("SetRadWindowSize('{0}')</script>", messageLabel.ClientID));
radScriptBlock.Controls.Add(new LiteralControl(scriptContent.ToString()));
return radScriptBlock;
}
#endregion
Please let us know if you have any solution.
Thanks,
We have used "autosize=true" for radwindow, but the radwindow is not getting autosized after the content on the page changes instead the horizontal and vertical scrollbars are coming. We are using AjaxPanel.
As you have specified that "The size of the content page is taken in window.onload. This means that if you change the size of the content page with Ajax, the RadWindow will not resize after the new content is displayed.".
Can you please tell us know where the problem is?
We have also tried with the following code on the Page_Load(). It is helping in autosizing, but on the continuous button clicks the size of the rad window grows horizontally till the end of the browser reaches.
#region RadWindow AutoSize
public void EnableRadWindowAutoSize(RadAjaxPanel radAjaxPanel, Label messageLabel)
{
radAjaxPanel.Controls.Add(SetRadWindowSizeRadScriptBlock(messageLabel));
}
public void EnableRadWindowAutoSize(RadAjaxManager radAjaxManager, Label messageLabel)
{
radAjaxManager.Controls.Add(SetRadWindowSizeRadScriptBlock(messageLabel));
}
private RadScriptBlock SetRadWindowSizeRadScriptBlock(Label messageLabel)
{
RadScriptBlock radScriptBlock = new RadScriptBlock();
System.Text.StringBuilder scriptContent = new System.Text.StringBuilder();
scriptContent.Append(@"
<script type='text/javascript'>
function SetRadWindowSize(messageLabelID)
{
try
{
var messageLabel = document.getElementById(messageLabelID);
if (messageLabel)
{
if (messageLabel.innerHTML.length > 0)
{
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 az well)
oWindow.autoSize();
}
}
}
catch (ex){}
}");
scriptContent.Append(String.Format("SetRadWindowSize('{0}')</script>", messageLabel.ClientID));
radScriptBlock.Controls.Add(new LiteralControl(scriptContent.ToString()));
return radScriptBlock;
}
#endregion
Please let us know if you have any solution.
Thanks,